Calling PaintBox Paint event

S

Sam

Hai,
I use a paintbox paint event to draw some images in a paintbox. I call
the paint event by refreshing the paintbox using paintboxname.refresh()
or paintboxname.update().

Problem with this kind of paint event is that the event is not raised
when the application is run in a minimized state. So, my question is:
How can you make sure that the paint event is called even when the
application is running in the minimized state.

Thanks
Sam
 
C

Chris

Sam said:
Hai,
I use a paintbox paint event to draw some images in a paintbox. I call
the paint event by refreshing the paintbox using paintboxname.refresh()
or paintboxname.update().

Problem with this kind of paint event is that the event is not raised
when the application is run in a minimized state. So, my question is:
How can you make sure that the paint event is called even when the
application is running in the minimized state.

Thanks
Sam

Why do you need to draw on a box when it is minimized? When the picture
box comes into view it is going to have to repaint. Doing it early is
useless unless you are saving it as a bitmap or something and if that is
the case you are going to have to draw to a different object.

Chris
 
S

Sam

Thanks for your reply.
I handle some other things within the same event - like storing 10,000
points of a waveform and comparing them for the required result. If I
seperate drawing the image and storing the points into two different
methods, the application gets quite slower which is what is needed.


So, I am still looking on how we can fire the Paint event of the
Picturebox.
Simillar thread:
http://groups.google.com/group/micr...tem.Windows.Forms.PaintEventArgs&rnum=1&hl=en
 
C

Chris

Sam said:
Thanks for your reply.
I handle some other things within the same event - like storing 10,000
points of a waveform and comparing them for the required result. If I
seperate drawing the image and storing the points into two different
methods, the application gets quite slower which is what is needed.


So, I am still looking on how we can fire the Paint event of the
Picturebox.
Simillar thread:
http://groups.google.com/group/micr...tem.Windows.Forms.PaintEventArgs&rnum=1&hl=en

Can you show some code. Separating out the drawing and the storing into
two different areas should not effect the speed of the system. Drawing
only when needed should actually speed up the system.

Chris
 
S

Sam

Hello Chris,

I have seperated the drawing routines from storing routines.
Surprisingly there was no penalty in time for doing that.
That could be because the paint event runs as a seperate thread.

Thanks for your suggestions. I appreciate your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top