c++ - Need help in optimizing a drawing code ... -


I need some help in trying to customize the part of this code ... this is actually ... I am writing this as 'Calligraphy Hydration' which easily draws very adjacent lines ... The problem is: When I update the draw area using the update () after each single draw of a slotted line, So the output is correct, it means that the update is done on time, so that the pen Abuse by 'drawn' to be 'everything was immediately portrayed seen. However, because too many (100s of them) have been updated, Program N900 is slowed down while running ...

When I all Stretch Lines (So that everyone trying to optimize slightly by running the update after the drawing lines are updated on the drawing board through a single update), the output is ... weird .... this is the lines Immediately after drawing, those lines are broken (they are empty patch where d Raine should have happened as well) ... However, if I trigger to revise the form window (eg, by changing the size of the form), then the broken patch is fixed immediately !! When I start this program If I run on my N900, then this initial breaks out and remains like this, because I do not know how to apply any redraw in this case ...

This is the first 'customized' Is' code and output (partially True / False)

  Zero canvas :: Drawline (Constant Point and Endpoint) {CoPenator (and image) painter; painter.setPen (QPen (QT :: Black, 1, QT :: SolidLine, QT :: RoundCap, QT :: RoundJoin); Int fx = 0, fy = 0, k = 0; QPoints.clear (); ConnectingPointsCalculator2 (qPoints, lastPoint.x (), lastPoint.y (), endPoint.x (), endPoint.y ()); Int i = 0; Int x, y; For (i = 0; i  

Image immediately after the script on the screen:

After re-adjusting the window's size, all the above are broken Links have been fixed as they

Zero canvas:

: Drainline (Constant Q Point End End point (couponeter painter (& image); painter.setPen (QPen (QT :: black, 1, QT :: SolidLine, QT :: RoundCap, QT :: RoundJoin)); int fx = 0, fy = 0, k = 0; qPoints.clear (); connectingPointsCalculator2 (qPoints, lastPoint.x), lastPoint.y (), endPoint.x (), endPoint.y ()); int i = 0; int x, y For A (i = 0; i & lt; qPoints.size (); i ++) {x = qPoints.at (i) .x (); y = qPoints.at (i) .y (); painter.setPen (QT :: Black); painter.drawLine (X5, Y-5, x + 5, Y + 5); ** Attract slotted lines ** ** // Loop updating frequently : ** Update (Qextract (X-5, Wi-5), Qpoint (X + 5, Y + 5). Normalized ()); // adjusted (-rad, -rad, red, red)); } Modified = true; Int rad = (myPenWidth / 2) + 2; Final point = end point; }

Can anyone see what the problem might be?

As I have understood that you have minimum and maximum X and Y processed in your for-loop And should be used in update (QRect (QPoint (minX-5, minY-5), QPoint (maxx + 5, maxy + 5).) Generalized ());


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -