Click here to Skip to main content
14,982,680 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Linker problem Pin
ThatsAlok22-Dec-05 19:43
MemberThatsAlok22-Dec-05 19:43 
GeneralRe: Linker problem Pin
ThatsAlok22-Dec-05 21:33
MemberThatsAlok22-Dec-05 21:33 
QuestionCOM in C language. Pin
pc_dev22-Dec-05 1:07
Memberpc_dev22-Dec-05 1:07 
AnswerRe: COM in C language. Pin
Cedric Moonen22-Dec-05 1:53
MemberCedric Moonen22-Dec-05 1:53 
GeneralRe: COM in C language. Pin
pc_dev22-Dec-05 19:51
Memberpc_dev22-Dec-05 19:51 
AnswerRe: COM in C language. Pin
Andy Moore22-Dec-05 6:44
MemberAndy Moore22-Dec-05 6:44 
GeneralRe: COM in C language. Pin
pc_dev22-Dec-05 19:53
Memberpc_dev22-Dec-05 19:53 
QuestionUsing a mask for drawing non rectangular bitmaps Pin
Ward22-Dec-05 0:36
MemberWard22-Dec-05 0:36 
I have a problem with drawing a non rectangular bitmap using a mask bitmap.
The two bitmaps are derived from an icon file in the resources. I want to create a HBITMAP object that contains the correct result of the masked drawing.

<br />
HICON hIcon5 = LoadIcon(hInstance,MAKEINTRESOURCE(IDI_ICON12));<br />
GetIconInfo(hIcon5, &iinfo);//retreive the <br />
BITMAP bm;<br />
GetObject(iinfo.hbmColor,sizeof(bm),&bm);<br />
<br />
HDC hdcToolbar = GetDC(hToolbar);//hToolbar is a window<br />
HDC hdcBitmap5 = CreateCompatibleDC(hdcToolbar);<br />
HDC hdcMask = CreateCompatibleDC(hdcToolbar) ;<br />
HDC hdcColor = CreateCompatibleDC(hdcToolbar) ;<br />
<br />
HBITMAP hBitmap5 = CreateCompatibleBitmap(hdcBitmap5,bm.bmWidth,bm.bmHeight);<br />
HGDIOBJ hOldBitmap5 = SelectObject(hdcBitmap5, hBitmap5);<br />
HGDIOBJ hOldMask = SelectObject(hdcMask, iinfo.hbmMask) ;<br />
HGDIOBJ hOldColor = SelectObject(hdcColor, iinfo.hbmColor);<br />
	<br />
//Now comes the difficult part where I can't find the solution<br />
BitBlt (hdcBitmap5, 0, 0, bm.bmWidth,bm.bmHeight, NULL, 0, 0, WHITENESS);<br />
BitBlt (hdcBitmap5, 0, 0, bm.bmWidth,bm.bmHeight, hdcMask, 0, 0, 0x220326);//found this code in Pedzold, chapter 14)<br />
BitBlt (hdcBitmap5, 0, 0, bm.bmWidth,bm.bmHeight, hdcColor, 0, 0, SRCPAINT) ;<br />
		<br />
SelectObject(hdcMask, hOldMask) ;<br />
SelectObject(hdcColor, hOldColor);<br />
SelectObject(hdcBitmap5, hOldBitmap5);<br />
DeleteDC(hdcMask);<br />
DeleteDC(hdcColor);<br />
DeleteDC(hdcBitmap5);<br />
ReleaseDC(hToolbar, hdcToolbar);<br />


Download the icon i used for the test here

Can someone help me please?

thanks in advance,

Ward
AnswerRe: Using a mask for drawing non rectangular bitmaps Pin
PJ Arends22-Dec-05 8:43
professionalPJ Arends22-Dec-05 8:43 
AnswerRe: Using a mask for drawing non rectangular bitmaps Pin
Ward25-Dec-05 10:08
MemberWard25-Dec-05 10:08 
QuestionGetMenu() returns NULL for Visual Studio 2003 Pin
Owner drawn22-Dec-05 0:29
MemberOwner drawn22-Dec-05 0:29 
Question_tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 0:16
MemberNishad S22-Dec-05 0:16 
AnswerRe: _tcscpy Vs lstrcpy Pin
toxcct22-Dec-05 0:31
Membertoxcct22-Dec-05 0:31 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 0:43
MemberNishad S22-Dec-05 0:43 
GeneralRe: _tcscpy Vs lstrcpy Pin
Blake Miller22-Dec-05 5:41
MemberBlake Miller22-Dec-05 5:41 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 16:23
MemberNishad S22-Dec-05 16:23 
AnswerRe: _tcscpy Vs lstrcpy Pin
ThatsAlok22-Dec-05 0:53
MemberThatsAlok22-Dec-05 0:53 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 0:56
MemberNishad S22-Dec-05 0:56 
AnswerRe: _tcscpy Vs lstrcpy Pin
Aamir Butt22-Dec-05 18:58
MemberAamir Butt22-Dec-05 18:58 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 19:01
MemberNishad S22-Dec-05 19:01 
Questiontemplate with Iterator - some Problems Pin
tbrake22-Dec-05 0:08
Membertbrake22-Dec-05 0:08 
AnswerRe: template with Iterator - some Problems Pin
Sebastian Schneider22-Dec-05 0:47
MemberSebastian Schneider22-Dec-05 0:47 
GeneralRe: template with Iterator - some Problems Pin
tbrake22-Dec-05 0:57
Membertbrake22-Dec-05 0:57 
GeneralRe: template with Iterator - some Problems Pin
Sebastian Schneider22-Dec-05 1:23
MemberSebastian Schneider22-Dec-05 1:23 
GeneralRe: template with Iterator - some Problems Pin
tbrake22-Dec-05 1:43
Membertbrake22-Dec-05 1:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.