Originally posted by: deepthi
How do I set background colour black and foreground colour towhite where foreground has a line of definite width and length
ReplyOriginally posted by: srinivasan
How to reload the bitmap using serialization.
Originally posted by: Hector
Where is the article: TransparentBlt using only two BLT operations - m.chung (1998/12/18)?
I need it. Thanks
ReplyOriginally posted by: J.Reichard
Thanks a million!
Reply
Originally posted by: Tao Zhou
Thanks
ReplyOriginally posted by: Stephan Brenner
First I tried your function, but I had problems when printing. So I wrote my own short function using an image-list for drawing the bitmap transparently.
void TransparentBlt(CDC* pDC, HBITMAP hBitmap, CPoint ptLocation)
{
CBitmap* pBitmap = CBitmap::FromHandle(hBitmap);
// Get size of bitmap
BITMAP bmpInfo;
CSize bitSize;
pBitmap->GetBitmap(&bmpInfo);
bitSize = CSize(bmpInfo.bmWidth, bmpInfo.bmHeight);
// Prepare ImageList
CImageList imageList;
imageList.Create(bitSize.cx, bitSize.cy, ILC_COLOR24|ILC_MASK, 1, 1);
imageList.Add(pBitmap, 0xFFFFFF); // Transparent color: WHITE
// Draw imagelist transparently
imageList.DrawIndirect(pDC, 0, ptLocation, bitSize, CPoint(0, 0));
}
Reply
Originally posted by: Andrey Zwyagilskii
I spent many time trying to force this function work. But have no result. I use CImageList for this purpose. It is 2 lines of code need to draw system color bitmap transparently:
m_ImgLst.Create( IDB_BITMAP, 16, 1, RGB(0,255,255) );
m_ImgLst.Draw(pDC,0,CPoint(x0,y0),ILD_TRANSPARENT);
This method works perfectly to all images.
ReplyOriginally posted by: Morten Andersen
I tried your routine, but instead of getting a transparent blit, I got an all black output. The bitmap I'm copying from is 256 colors, and the bitmap I'm blitting to is 16M colors. Can that have anything to do with it ?
Please tell me what went wrong, and how I can fix it.
- Morten Andersen
ReplyOriginally posted by: Ren
I am trying to place a bitmap on my dialog based MFC project. I have used double buffering in OnInitDialog() and OnPaint(), but It didn't work to draw, bitmaps, even to SetBkColor(). Any help is appriciated.
Ren.
Hi,
Originally posted by: Greg Heck
Be careful using this one in Windows 2000 and Windows 98. The Windows API has added the function TransparentBlt.
Reply