onPaint question

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
 
H

Herfried K. Wagner [MVP]

* "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'.
 
J

John Smith

OnPaint sucks and originates too much flicker

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

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