Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change colours in a bitmap DC

Status
Not open for further replies.

bulgakov

Programmer
Apr 24, 2003
26
GB
All,
I am writing a bitmap to a file, however after I bit blat
with BitBlt how can I change all references from one colour
to another ? I am trying to change the blue background to
white so I can save the image with a white background.
Thanks.


CBitmap bitmap;
CClientDC dc(pwd);
CDC memDC;
CRect rect;

memDC.CreateCompatibleDC(&dc);

pwd->EnableWindow(FALSE );

pwd->GetClientRect(rect);
bitmap.CreateCompatibleBitmap(&dc, rect.Width(),rect.Height() );

CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);

memDC.BitBlt(0, 0, rect.Width(),rect.Height(), &dc, 0, 0, SRCCOPY);

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top