Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

.DrawText makes my app laggy/sluggish (MFC C++)

karhongkarhong Member Posts: 14
Hi,

I've search throughout the net, cant find any solution. Hope someone able to help me.

My apps had a panel which can draw many rect. The app can be moved by draggin left/right using mouse. Whenever i moved the panel, it'll try to move all the rectangle to top/bottom/left/right following the mouse motion. When the mouse move, it will force the rectangle to be redraw. My app become laggy whenever i use .DrawText to a multiple line of text inside the rectangle.

I have around 80++ rect which used .DrawText to display the text on each rect.

I've tested, if the text is only 1 short words without /r/n (one line), then it will display nicely without laggy.
eg:

Alice

But if the text is in multiline (about 4~5 lines) i tried to run .DrawText, it makes my apps lagg.
eg:

Alice
in
wonderland

Any idea ??

The command i used :

dc.DrawText(strDraw, rcText, DT_LEFT | DT_WORD_ELLIPSIS);


Regards,
KH
Sign In or Register to comment.