nanogui@linuxhacker.org

nanogui@linuxhacker.org


Subject: Re: Reading and Displaying a Bitmap at runtime
From: Greg Haerr
Date: Tue, 5 Dec 2000 11:05:24 -0700

:       psd = GdOpenScreen();
:       
: GdDrawImageFromFile(psd,0,0,640,480,"zee.bmp",PSF_SCREEN|PSF_HAVEBLIT);
: 
:       GdCloseScreen(psd);

First, don't call GdOpenScreen, that's long been done before
your WinMain got called.  use &scrdev for the first argument.

Second, we're calling an engine function directly, which is not
normally supported, so all of your coordinates need to be
adjusted for the current window offset.  Check out code in
in mwin/wingdi.c to see how this is done.  You might try
looking at at SetPixel.  Basically, you need to add the
hwnd->clirect.left and hwnd->clirect.top to the x,y coords.

Finally, just pass 0 for the last parm.

Regards,

Greg



nanogui@linuxhacker.org