.DrawText makes my app laggy/sluggish (MFC C++)
-
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
good
-
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
good
Cannot believe
DrawText
makes your system lag. Please post the relevant code. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Cannot believe
DrawText
makes your system lag. Please post the relevant code. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
OK. And what about the 'relevant code'? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
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
good