nanogui: Reading and Displaying a Bitmap at runtime
Subject:
Re: Reading and Displaying a Bitmap at runtime
From:
"Greg Haerr" ####@####.####
Date:
5 Dec 2000 18:03:12 -0000
Message-Id: <0b5601c05ee5$f1631c60$15320cd0@gregh>
: 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