Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Connect to IRC server Pin
Thilek4-Jan-10 19:25
Thilek4-Jan-10 19:25 
Questiondisable CString value Pin
Rakesh53-Jan-10 20:41
Rakesh53-Jan-10 20:41 
AnswerRe: disable CString value Pin
KingsGambit3-Jan-10 20:50
KingsGambit3-Jan-10 20:50 
AnswerRe: disable CString value Pin
Cedric Moonen3-Jan-10 20:55
Cedric Moonen3-Jan-10 20:55 
AnswerRe: disable CString value Pin
«_Superman_»3-Jan-10 21:12
professional«_Superman_»3-Jan-10 21:12 
AnswerRe: disable CString value Pin
Nelek3-Jan-10 22:02
protectorNelek3-Jan-10 22:02 
AnswerRe: disable CString value Pin
Rajesh R Subramanian3-Jan-10 22:15
professionalRajesh R Subramanian3-Jan-10 22:15 
AnswerRe: disable CString value Pin
Michael Schubert4-Jan-10 5:10
Michael Schubert4-Jan-10 5:10 
GeneralRe: disable CString value Pin
CPallini4-Jan-10 11:36
mveCPallini4-Jan-10 11:36 
GeneralRe: disable CString value Pin
Michael Schubert4-Jan-10 22:00
Michael Schubert4-Jan-10 22:00 
GeneralRe: disable CString value Pin
CPallini4-Jan-10 22:27
mveCPallini4-Jan-10 22:27 
QuestionAssertion error in SetWindowPos() Pin
Anu_Bala3-Jan-10 19:01
Anu_Bala3-Jan-10 19:01 
AnswerRe: Assertion error in SetWindowPos() Pin
KingsGambit3-Jan-10 19:34
KingsGambit3-Jan-10 19:34 
AnswerRe: Assertion error in SetWindowPos() Pin
«_Superman_»3-Jan-10 19:36
professional«_Superman_»3-Jan-10 19:36 
GeneralRe: Assertion error in SetWindowPos() Pin
Anu_Bala3-Jan-10 20:09
Anu_Bala3-Jan-10 20:09 
GeneralRe: Assertion error in SetWindowPos() Pin
KingsGambit3-Jan-10 20:22
KingsGambit3-Jan-10 20:22 
GeneralRe: Assertion error in SetWindowPos() Pin
Anu_Bala3-Jan-10 22:13
Anu_Bala3-Jan-10 22:13 
QuestionMatrix class h Pin
richard cyper3-Jan-10 13:19
richard cyper3-Jan-10 13:19 
AnswerRepost. Pin
CPallini3-Jan-10 13:44
mveCPallini3-Jan-10 13:44 
AnswerRe: Matrix class h Pin
Cedric Moonen3-Jan-10 20:27
Cedric Moonen3-Jan-10 20:27 
AnswerRe: Matrix class h Pin
Alan Balkany6-Jan-10 4:00
Alan Balkany6-Jan-10 4:00 
QuestionDrawing 32 bit bitmaps Pin
softwaremonkey3-Jan-10 10:53
softwaremonkey3-Jan-10 10:53 
Hi,

I am loading a 32 bit bitmap (24 bit + alpha channel) into a CImageList and then attempting to draw it without much success. The 'transparent' bits are drawn in black. If I specify black as the mask when I add the bitmap it works OK but this means I cant have any black pixels in the bitmap.

Does anyone know what is needed to make this work. For info, I am dioing the following...

Loading the bitmap...
HBITMAP hBM = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), s, 
	IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
	
if(hBM)	// Success?
{
	BITMAP bmp;
	::GetObject(hBM, sizeof(bmp), &bmp);	// Get bitmap info
		
	UINT flags;
	switch(bmp.bmBitsPixel)
	{
	case 4:
	flags = ILC_COLOR4;
	break;

	case 8:
	flags = ILC_COLOR8;
	break;

	case 16:
	flags = ILC_COLOR16;
	break;

	case 24:
	flags = ILC_COLOR24;
	break;

	case 32:
	flags = ILC_COLOR32;
	break;
	}
	
	m_imageList.DeleteImageList();		// Clear image list
	m_nImageWidth = bmp.bmWidth / m_nStates / m_nStyles;
	m_nImageHeight = bmp.bmHeight;
	m_imageList.Create(m_nImageWidth, m_nImageHeight, flags | ILC_MASK, m_nStates * m_nStyles, 0);

	CBitmap bm;
	m_bImageLoaded = true;
	bm.Attach(hBM);
	m_imageList.Add(&bm, RGB(255,0,255));


And drawing...
if(m_bImageLoaded)
{
	m_imageList.Draw(pDC, nImage, loc, ILD_NORMAL);
}


Thanks

Tony Thumbs Up | :thumbsup:
AnswerRe: Drawing 32 bit bitmaps Pin
«_Superman_»3-Jan-10 15:43
professional«_Superman_»3-Jan-10 15:43 
AnswerRe: Drawing 32 bit bitmaps Pin
Joe Woodbury3-Jan-10 15:58
professionalJoe Woodbury3-Jan-10 15:58 
AnswerRe: Drawing 32 bit bitmaps Pin
Naveen3-Jan-10 16:54
Naveen3-Jan-10 16:54 

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.