--- Nicholas Pleis wrote:
> On 4 bit greyscale devices, it seems like
> WinDrawChars (and its cousin WinPaintChars) 
> do not render properly when the draw window 
> is set to something beside the screen:
> 
> WinSetDrawWindow(someValidHandle);
> 
> WinDrawChars("Test",4, 15, 15);
> 
> When I do this, nothing shows up. 

Nothing shows up where?  How are you looking at the
window you drew on?  How can we be sure
someValidHandle is a valid WindowHandle?

Here's some (bad, but working) code that demonstrates
how to change the draw window:

  BitmapType *bmpP;
  WinHandle bitmapWin, screenWin;
  Err error;
  RectangleType srcRect = {0,0,160,160};
        
  bmpP = BmpCreate(160, 160, 8, NULL, &error);
  if (bmpP) 
  {
    bitmapWin = WinCreateBitmapWindow(bmpP, &error);
    if (bitmapWin) 
    {
      // save current draw window
      screenWin = WinGetDrawWindow();
      // change the draw window
      WinSetDrawWindow(bitmapWin);
      // draw something
      WinDrawChars("Test", 4, 15, 15);
      // restore the draw window
      WinSetDrawWindow(screenWin);
      // copy the entire bitmap to the screen
      WinCopyRectangle (bitmapWin, screenWin,
&srcRect, 0, 0, winPaint);
    }
  }


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

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

Reply via email to