| View previous topic :: View next topic |
| Author |
Message |
stjepan
Joined: 11 Apr 2005 Posts: 22 Location: Croatia
|
Posted: Wed Apr 27, 2005 11:41 am Post subject: Background image for window on Windows |
|
|
I use: | Code: | paintDelegate ~= delegate void(Component source, GContext gc) {
HBITMAP bmp = cast(HBITMAP)LoadImageA(null, "img/background.bmp", IMAGE_BITMAP, 0, 0, 0x10);
SelectObject(gc.peer, bmp);
BitBlt(gc.peer, 0, 0, 700, 700, GetDC(bmp), 0, 0, 0xCC0020);
gc.flush();
}; | It doesn't work. I don't know very much about WinAPI.  _________________ I speak a little English. I am beginner in programming. I know C++, C# and D. |
|
| Back to top |
|
 |
BenHinkle
Joined: 27 Mar 2004 Posts: 76
|
Posted: Thu Apr 28, 2005 8:32 pm Post subject: |
|
|
Try something like
| Code: |
paintDelegate ~= delegate void(Component source, GContext gc) {
HBITMAP bmp = cast(HBITMAP)LoadImageA(null, "img/background.bmp", IMAGE_BITMAP, 0, 0, 0x10);
HDC bmpdc = CreateCompatibleDC(gc.peer);
SelectObject(bmpdc, bmp);
BitBlt(gc.peer, 0, 0, 700, 700, bmpdc, 0, 0, 0xCC0020);
gc.flush();
DeleteDC(bmpdc);
DeleteObject(bmp);
};
|
Caching the handles so that they are create and deleted every time through the paint delegate would speed up the drawing if needed. |
|
| Back to top |
|
 |
stjepan
Joined: 11 Apr 2005 Posts: 22 Location: Croatia
|
Posted: Fri Apr 29, 2005 2:59 pm Post subject: |
|
|
Now it works, thanks. _________________ I speak a little English. I am beginner in programming. I know C++, C# and D. |
|
| Back to top |
|
 |
sshenzhuzhu
Joined: 14 Nov 2011 Posts: 2
|
Posted: Wed Nov 30, 2011 10:00 pm Post subject: |
|
|
On the wedding day, the beautiful girl wearing that mermaid wedding dress caught all the attention in the small town. wedding dresses 2012 The mermaid wedding dress is perfectly set off her figure.vintage wedding dresses After then all the women in the town copied it and wanted to be as beautiful as her.plus size wedding dressesHer mother blessed her and her offspring through that mermaid wedding dress. lace wedding dresses Since thenthe dress became a heirloom, all the brides who wore it lived a long happy life with her lover _________________ SS |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|