Calling PaintBox Paint event

  • Thread starter Thread starter Sam
  • Start date Start date
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
 
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
 
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
 
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
 
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.
 
Back
Top