Subject:
Re: [nanogui] How to load a bitmap?
From:
"Franco Casadei" ####@####.####
Date:
24 Jan 2007 15:13:56 +0000
Message-Id: <004b01c73fca$2a089e20$0300a8c0@franco>
I've tried your code, but I get an .."undefined referenced to
_GdGetImage()..."
Probably I do not include the graphic engine properly from my application.
I just
#include <windows.h>
and link to to libmwin.a and libmwimages.a libraries,
but this doesn't suffice.
Do you known what is missing?
Thanks,
Casadei Franco
ITALY
> ----- Original Message -----
> From: "Uwe Klatt" ####@####.####
> To: ####@####.####
> Sent: Wednesday, January 24, 2007 12:51 PM
> Subject: Re: [nanogui] How to load a bitmap?
>
>
>> Hello,
>>> I'm using Microwindow with Win32 Api; I cannot figure out how is
>>> possible to load a bitmap and show it in my window (at x,y position)
>>> in a similar way provided by GrLoadImageFormFile() for those who use
>>> Nano-X api.
>>
>> I am using something like this:
>>
>> void DrawImage(HWND hWnd, HDC hdc, int x, int y, int dx, int dy, char
>> *filename)
>> {
>> HDC hdcMem;
>> HBITMAP hbmp, hbmpOrg;
>> PMWIMAGEHDR image;
>> int image_id;
>> image_id = GdLoadImageFromFile(hdc->psd,filename,0);
>> hdcMem = CreateCompatibleDC(hdc);
>> image = (PMWIMAGEHDR)GdGetImage(image_id);
>> hbmp = CreateCompatibleBitmap(hdcMem, image->width, image->height);
>> hbmpOrg = SelectObject(hdcMem, hbmp);
>> DrawDIB(hdcMem, 0, 0, image);
>> StretchBlt(hdc, x, y, dx, dy, hdcMem, 0, 0, image->width-1,
>> image->height-1,
>> MWROP_SRCCOPY);
>> DeleteObject(SelectObject(hdcMem, hbmpOrg));
>> DeleteDC(hdcMem);
>> GdFreeImage(image_id);
>> return;
>> }
>>
>> Bye
>> Uwe
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ####@####.####
>> For additional commands, e-mail: ####@####.####
>>
>>
>