CImageList when .draw -> no more transparent
-
Hi, I'm loading resource>toolbar into CImageList When i draw using imageList.draw, then the transparent is no more work any idea? CImageList ImgList; COLORREF rgbTransparentColor = RGB(73,73,73);//dono what this use.. CBitmap bmp; int bubu = bmp.LoadBitmapW(IDR_MAINFRAME);//the toolbar to be loaded ImgList.Create(16.5,14.5,ILC_MASK | ILC_COLOR32,1,1); ImgList.Add(&bmp, rgbTransparentColor);//put the bitmap into imagelist CPoint ptImage(rectIcon.left + 1, rectIcon.top + 1);//get the point(position) of the rectangle to be drawn ImgList.Draw(pDC, nIconPosi, ptImage, ILD_NORMAL);//draw the icon
good
-
Hi, I'm loading resource>toolbar into CImageList When i draw using imageList.draw, then the transparent is no more work any idea? CImageList ImgList; COLORREF rgbTransparentColor = RGB(73,73,73);//dono what this use.. CBitmap bmp; int bubu = bmp.LoadBitmapW(IDR_MAINFRAME);//the toolbar to be loaded ImgList.Create(16.5,14.5,ILC_MASK | ILC_COLOR32,1,1); ImgList.Add(&bmp, rgbTransparentColor);//put the bitmap into imagelist CPoint ptImage(rectIcon.left + 1, rectIcon.top + 1);//get the point(position) of the rectangle to be drawn ImgList.Draw(pDC, nIconPosi, ptImage, ILD_NORMAL);//draw the icon
good
-
karhong wrote:
RGB(73,73,73);//
Is this the color in the bitmap that you want to make transperent?
-
yea.. i hope to make the imgList.Draw icons to have the background color of RGB(73,73,73)
good
Either I am misunderstanding you, or you are misunderstanding the API. The transparent colour is the colour in the original bitmap that you want to become transparent. I normally use a hideous shade of purple, or pink. I'm too manly to use them for actual display. There is nothing stopping you using a certain shade of gray (RGB(73,73,73)), but it will be less obvious when you are editing the original bitmap. For debugging the sort of problem you have, I strongly recommend the excellent article http://www.codeproject.com/KB/applications/imageviewer.aspx[^] by PJ Arends. Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...