Hello,
I would like to use double bufferning to hide any flicker as my forms are 
drawn.

When I use some double buffering I usually use some code that looks like 
this:

RectangleType lRect;
 WinHandle lOffscreen, lOnscreen;
 Err err;
 //save to back buffer
 {
    lOnscreen = WinGetDrawWindow();
    if (lOnscreen)
    {
      lRect.topLeft.x = 0;
      lRect.topLeft.y = 0;
     WinGetWindowExtent(&lRect.extent.x, &lRect.extent.y);
      lOffscreen = WinCreateOffscreenWindow(lRect.extent.x, lRect.extent.y, 
nativeFormat, &err);
     WinCopyRectangle(lOnscreen, lOffscreen, &lRect, 0, 0, winPaint);
     WinSetDrawWindow(lOffscreen);
    }
 }

.... insert drawing code here

{
  WinSetDrawWindow(lOnscreen);
  WinCopyRectangle(lOffscreen, lOnscreen, &lRect, 0, 0, winPaint);
  WinDeleteWindow(lOffscreen, false);
 }


Now if I try to do call this code before FrmDrawForm in the frmOpenEvent 
event it doesn't work because WinGetDrawWindow returns null.
How then should I use double buffering at this time.

Best regards
Benoit 



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to