RossWright
Programmer
While painting, I need to be able to detect when a resizing operation on a form is in progress (the user has the mouse button down) and when it has completed (the user has let go of the button). From what I've been able to gather from experimentation and documentation, the only notification provided by WinForms about resizing are the SizeChanged, Resize and Layout events, all of which are called every time the mouse is moved during a resize operation and none of which are called when the user releases the mouse button to stop resizing.
Why do I need this? I am writing an application that does some pretty time consuming rendering. I render to a bitmap which I keep around and then just blit that bitmap when I get an OnPaint instead of re-rendering. The only time I re-render to the bitmap is when the parameters of the data I'm rendering change or... and here's my problem...the user changes the size of the rendering area, the window. Here's some pseudo-code to help explain:
OnPaint
{
if ( data.Changed || (just finished resize operation) )
{
bitmap = data.Render( this.Size )
// This could take a minute or two
}
bitmap.Blit()
}
Why do I need this? I am writing an application that does some pretty time consuming rendering. I render to a bitmap which I keep around and then just blit that bitmap when I get an OnPaint instead of re-rendering. The only time I re-render to the bitmap is when the parameters of the data I'm rendering change or... and here's my problem...the user changes the size of the rendering area, the window. Here's some pseudo-code to help explain:
OnPaint
{
if ( data.Changed || (just finished resize operation) )
{
bitmap = data.Render( this.Size )
// This could take a minute or two
}
bitmap.Blit()
}