can i change the HBITMAP structure for be transparent?
because the gif's files are show me a black background color.
cambalinho 142 Practically a Posting Shark
Recommended Answers
Jump to PostThe first thing you need to do is select the
HBITMAP
into aMemoryDC
. Then you cna use theAlphaBlend
function to draw it to theWindowDC
.If the
MemoryDC
is NOT compatible with theWindowDC
, this will fail! In that case, you can …
Jump to PostEverytime you do
GetDC
, you are leaking a DC. You NEED toReleaseDC
.Even if you do
DC = GetDC(NULL)
you need to doReleaseDC(NULL, DC);
. If you doDC = GetDC(hwnd)
you need to doReleaseDC(hwnd, DC);
.In the above code, you don't …
Jump to Postvoid Draw(HBITMAP hBitmap, HDC hdc) { BITMAP bm; GetObject(hBitmap, sizeof(bm), &bm); HDC MemDCExercising = CreateCompatibleDC(hdc); HGDIOBJ obj = SelectObject(MemDCExercising, hBitmap); BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, MemDCExercising, 0, 0, SRCCOPY); SelectObject(MemDCExercising, obj); DeleteDC(MemDCExercising); } void DrawTransparent(HBITMAP hBitmap, HDC hdc, COLORREF Colour) { BITMAP bm; GetObject(hBitmap, sizeof(bm), &bm); HDC …
All 11 Replies
SalmiSoft 102 Junior Poster
cambalinho 142 Practically a Posting Shark
triumphost 120 Posting Whiz
cambalinho 142 Practically a Posting Shark
triumphost 120 Posting Whiz
cambalinho 142 Practically a Posting Shark
cambalinho 142 Practically a Posting Shark
cambalinho 142 Practically a Posting Shark
triumphost 120 Posting Whiz
cambalinho 142 Practically a Posting Shark
triumphost 120 Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.