> Hi,
> 
> I want to draw some stuff offscreen before I display it. I am using
> WinDrawRectangle and find that it gets drawn to the screen and the offscreen
> window that I create. How do I prevent it from drawing to the screen? I am
> using Palm OS 3.5 for this project. Here is some code (fragments,
> unimportant stuff removed) that I am using.

  are you sure it is drawing to the real screen as well? maybe you can
  test this by just forgetting to copy the rectangle? the display can 
  be pretty strange when it updates - so you may have the feeling it is  
  drawing to both.
 
> static void MainUpdateForm(void)
> {
>    RectangleType r = colorRect;
>    FormPtr pForm = FrmGetActiveForm();
>    WinHandle hScreen, hOffscreen = NULL;
>    RectangleType rect;
>    UInt16 err;
> 
>    FrmDrawForm(pForm);
> 
>    // set display to hOffscreen
>    hOffscreen = WinCreateOffscreenWindow(160, 144, screenFormat, &err);
>    hScreen = WinSetDrawWindow(hOffscreen);
> 
>    // massive code removed
>    loop() {
>          WinSetForeColor(something);
>          WinDrawRectangle(&r, 0);
>    }
> 
>    // set display back to screen
>    hOffscreen = WinSetDrawWindow(hScreen);
>    // copy keyboard to screen
>    rect.topLeft.x = 0;
>    rect.topLeft.y = 0;
>    rect.extent.x  = 160;
>    rect.extent.y  = 144;
> //  WinCopyRectangle(hOffscreen, hScreen, &rect, 0, COLORS_TOP, winPaint);
> }

  if not? then maybe there is a little problem with WinDrawRectangle? i
  doubt it tho - as i have used it on previous OS's without a problem 
  (i have not yet tested it on 3.5)

  your code looks fine.

  cheers

az.
--
Aaron Ardiri 
Java Certified Programmer      http://www.hig.se/~ardiri/
University-College i G�vle     mailto:[EMAIL PROTECTED]
SE 801 76 G�vle SWEDEN       
Tel: +46 26 64 87 38           Fax: +46 26 64 87 88
Mob: +46 70 656 1143           A/H: +46 8 668 78 72

if you enjoy it, then it aint work :) - rule #106 of life


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to