Hi
I have a sample code to draw lines on wxPanel, but sometimes (when wxPen's wide is bigger than 1)it works slowly.
And what is the most strange for me, it works good if I run a lot of application on my computer, but if I run only this application it works slowly...
Thanks for help !
drawing on panel Topic is solved
drawing on panel
- Attachments
-
- main.cpp
- (2.27 KiB) Downloaded 359 times
Thank You for your quick replay !
I started to test this application more and I noticed that it works fine when I run any program which contains any graphics, for example my photo viewer or a website which contains Flash banner. If banner is moving application works fine, but when banner stops moving, application works slowly.
So maybe it is some problem with graphics?
I started to test this application more and I noticed that it works fine when I run any program which contains any graphics, for example my photo viewer or a website which contains Flash banner. If banner is moving application works fine, but when banner stops moving, application works slowly.
So maybe it is some problem with graphics?
This is perhaps a compositing issue; if you OS's compositor doesn't refetch the data because it thinks it doesn't need to.
What I would recommend, and that is highly recommended anyway, is to not rely on wxClientDC (alone). Handle paint events (see http://wiki.wxwidgets.org/Drawing_on_a_ ... tant_Notes ). Then you can perhaps simply remove the need for wxClientDC and just call for Refresh() when you need it.
True this will make your code more complicated, but really you have no choice, wxClientDC is meant for temporary drawings only, so this is bad for a drawing app where drawings should not be temporary
What I would recommend, and that is highly recommended anyway, is to not rely on wxClientDC (alone). Handle paint events (see http://wiki.wxwidgets.org/Drawing_on_a_ ... tant_Notes ). Then you can perhaps simply remove the need for wxClientDC and just call for Refresh() when you need it.
True this will make your code more complicated, but really you have no choice, wxClientDC is meant for temporary drawings only, so this is bad for a drawing app where drawings should not be temporary
"Keyboard not detected. Press F1 to continue"
-- Windows
-- Windows