onPaint question

  • Thread starter Thread starter Peter Ignarson
  • Start date Start date
P

Peter Ignarson

Hi - I have the following code to redraw some graphics on the background of
an MDI window each time it is resized. The problem is that the code in
RedrawWindow takes a lot of time and my simple program appears slow.

Protected Overrides Sub OnPaint(ByVal pe As PaintEventArgs)
MyBase.OnPaint(pe)
call RedrawWindow(pe.Graphics())
End Sub


Is there a way to just get the part of the window that needs redrawing from
pe so I can just redraw that part in RedrawWindow?

Thank you
Pete
 
* "Peter Ignarson said:
Hi - I have the following code to redraw some graphics on the background of
an MDI window each time it is resized. The problem is that the code in
RedrawWindow takes a lot of time and my simple program appears slow.

Protected Overrides Sub OnPaint(ByVal pe As PaintEventArgs)
MyBase.OnPaint(pe)
call RedrawWindow(pe.Graphics())
End Sub

Is there a way to just get the part of the window that needs redrawing from
pe so I can just redraw that part in RedrawWindow?

'pe.ClipRectangle'.
 
OnPaint sucks and originates too much flicker

draw a bitmap and set your control.image to the bitmap, no more flicker,
no more OnPaint
 
Back
Top