 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
TraxMate Master Cheater
Reputation: 0
Joined: 01 Mar 2008 Posts: 363
|
Posted: Tue Jan 25, 2011 9:22 pm Post subject: Transparent bitmap on button control |
|
|
I want to put a transparent bitmap on a button. So far I have been able to put a transparent bitmap on the main window using BitBlt but if I do that on the button I need to repaint it every time it updates.. I also thought of sending a BM_SETIMAGE message to the button but I don't know how to get a HBITMAP of the transparent bitmap.
Here's my code that shows a transparent bitmap in the main window:
| Code: |
HDC hdcOut, hdcMem;
BITMAP bmInfo;
HBITMAP hbmOld;
hdcOut = GetDC(hWnd);
hdcMem = CreateCompatibleDC(hdcOut);
hbmOld = (HBITMAP)SelectObject(hdcMem, g_hbmTraxMask);
GetObject(g_hbmTrax, sizeof(BITMAP), &bmInfo);
BitBlt(hdcOut, 0, 0, bmInfo.bmWidth, bmInfo.bmHeight, hdcMem, 0, 0, SRCAND);
SelectObject(hdcMem, g_hbmTrax);
BitBlt(hdcOut, 0, 0, bmInfo.bmWidth, bmInfo.bmHeight, hdcMem, 0, 0, SRCPAINT);
SelectObject(hdcMem, hbmOld);
DeleteDC(hdcMem);
ReleaseDC(hWnd, hdcOut);
|
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Jan 25, 2011 10:09 pm Post subject: |
|
|
hmm.
try creating a bitmap with CreateCompatableBitmap(), then SelectObject() said bitmap into your memory dc (created with CreateCompatableDC()) and then blit into your memory DC or something something fuck
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
| Back to top |
|
 |
TraxMate Master Cheater
Reputation: 0
Joined: 01 Mar 2008 Posts: 363
|
Posted: Thu Jan 27, 2011 1:54 pm Post subject: |
|
|
| Thanks for the help, owner drawn did exactly what I wanted. (Y)
|
|
| 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 You cannot attach files in this forum You can download files in this forum
|
|