Click here to Skip to main content
16,011,383 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: STL list / iterator question Pin
Joaquín M López Muñoz24-Jul-01 12:51
Joaquín M López Muñoz24-Jul-01 12:51 
GeneralRe: STL list / iterator question Pin
25-Jul-01 4:47
suss25-Jul-01 4:47 
GeneralRe: STL list / iterator question Pin
CodeGuy25-Jul-01 5:50
CodeGuy25-Jul-01 5:50 
GeneralOpening a window in a console application Pin
Adi Shavit24-Jul-01 6:54
Adi Shavit24-Jul-01 6:54 
QuestionHow do I add a custom mimize button? Pin
Tommy H D Svensson24-Jul-01 6:27
Tommy H D Svensson24-Jul-01 6:27 
AnswerRe: How do I add a custom mimize button? Pin
Tomasz Sowinski24-Jul-01 7:37
Tomasz Sowinski24-Jul-01 7:37 
GeneralTransparentBlt , Win95 ( not supported + problems ) Pin
Leon24-Jul-01 6:25
Leon24-Jul-01 6:25 
GeneralRe: TransparentBlt , Win95 ( not supported + problems ) Pin
24-Jul-01 10:32
suss24-Jul-01 10:32 
This is what U need
void MyTransparentBlt( HDC hdcDest, int nXDest, int nYDest, int nWidth,
int nHeight, HDC hBmpDC/*, HBITMAP hBitmap*/, int nXSrc, int nYSrc,
COLORREF colorTransparent, HPALETTE hPal)
{
HDC hdcMask = ::CreateCompatibleDC( hdcDest );
HDC hdcTmp = ::CreateCompatibleDC( hdcDest );
HBITMAP bmMask = ::CreateBitmap( nWidth, nHeight, 1, 1, NULL );
HBITMAP hOldMaskBitmap = (HBITMAP)::SelectObject( hdcMask, bmMask );
HBITMAP hTmpBmp = CreateCompatibleBitmap(hdcDest, nWidth, nHeight);
HBITMAP hOldTmpBmp = (HBITMAP)::SelectObject(hdcTmp, hTmpBmp);

::BitBlt(hdcTmp, 0,0,nWidth, nHeight, hBmpDC, nXSrc, nYSrc, SRCCOPY );

::SetBkColor( hdcTmp, colorTransparent );

::SetTextColor( hBmpDC, RGB( 0, 0, 0 ) );
::BitBlt( hdcMask, 0, 0, nWidth, nHeight, hdcTmp, 0, 0, SRCCOPY );
HDC hdcOffScr = ::CreateCompatibleDC(hdcDest);
::SetBkMode(hdcOffScr, TRANSPARENT);
HBITMAP hbmOffScr = ::CreateBitmap(nWidth, nHeight,
(BYTE)GetDeviceCaps(hdcDest, PLANES),
(BYTE)GetDeviceCaps(hdcDest, BITSPIXEL),
NULL);
HBITMAP hbmOldOffScr = (HBITMAP)::SelectObject(hdcOffScr, hbmOffScr);
::BitBlt(hdcOffScr, 0, 0, nWidth, nHeight, hdcDest, nXDest, nYDest, SRCCOPY);
::SetBkColor( hBmpDC, RGB( 0, 0, 0 ) );
::SetTextColor( hBmpDC, RGB( 0xff, 0xff, 0xff ));
COLORREF crOldBackColor = ::GetBkColor( hdcDest );
COLORREF crOldTextColor = ::GetTextColor( hdcDest );
::SetBkColor( hdcOffScr, RGB( 0xff, 0xff, 0xff ) );
::SetTextColor( hdcOffScr, RGB( 0, 0, 0 ) );
::BitBlt( hdcOffScr, 0, 0, nWidth, nHeight, hBmpDC, 0, 0, SRCINVERT );
::BitBlt( hdcOffScr, 0, 0, nWidth, nHeight, hdcMask, 0, 0, SRCAND );
::BitBlt( hdcOffScr, 0, 0, nWidth, nHeight, hBmpDC, 0, 0, SRCINVERT );
::SetBkColor( hdcOffScr, crOldBackColor );
::SetTextColor( hdcOffScr, crOldTextColor );
::SetBkMode(hdcDest, TRANSPARENT);

::BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcOffScr, 0, 0, SRCCOPY);
if ( hOldMaskBitmap )
::SelectObject( hdcMask, hOldMaskBitmap );
if ( hbmOldOffScr )
::SelectObject( hdcOffScr, hbmOldOffScr );
if ( hOldTmpBmp )
::SelectObject( hdcTmp, hOldTmpBmp );

::DeleteObject( hTmpBmp );
::DeleteObject( bmMask );
::DeleteObject( hbmOffScr );
::DeleteDC( hdcOffScr );
::DeleteDC( hdcTmp );

::DeleteDC( hdcMask );
}

but with more effort you could do your self(msdn etc), like I did it is a lot more fun !!

good luck,
Dror


GeneralRe: TransparentBlt , Win95 ( not supported + problems ) Pin
Christian Graus24-Jul-01 13:04
protectorChristian Graus24-Jul-01 13:04 
QuestionWhat would be magical about the Control ID of a radio Button? Pin
tm24-Jul-01 6:09
tm24-Jul-01 6:09 
Generalconverting decimal to hexadecimal Pin
24-Jul-01 6:07
suss24-Jul-01 6:07 
GeneralRe: converting decimal to hexadecimal Pin
Not Active24-Jul-01 7:24
mentorNot Active24-Jul-01 7:24 
GeneralDialog problem Pin
24-Jul-01 5:56
suss24-Jul-01 5:56 
GeneralRe: Dialog problem Pin
24-Jul-01 7:27
suss24-Jul-01 7:27 
Generalthis sample doesnf help me! Pin
24-Jul-01 10:55
suss24-Jul-01 10:55 
GeneralRe: this sample doesnf help me! Pin
Carlos Antollini24-Jul-01 11:10
Carlos Antollini24-Jul-01 11:10 
QuestionID?? Pin
24-Jul-01 5:12
suss24-Jul-01 5:12 
AnswerRe: ID?? Pin
Christian Graus24-Jul-01 13:06
protectorChristian Graus24-Jul-01 13:06 
QuestionSerialize : How can I know if the loading from the file success ??? Pin
24-Jul-01 5:04
suss24-Jul-01 5:04 
AnswerRe: Serialize : How can I know if the loading from the file success ??? Pin
CMFC6.0VS.NETUser24-Jul-01 5:20
CMFC6.0VS.NETUser24-Jul-01 5:20 
GeneralI think you dont understand me. Pin
24-Jul-01 10:23
suss24-Jul-01 10:23 
GeneralRe: I think you dont understand me. Pin
CMFC6.0VS.NETUser27-Jul-01 6:10
CMFC6.0VS.NETUser27-Jul-01 6:10 
GeneralRe: I think you dont understand me. Pin
Matt Gullett27-Jul-01 6:30
Matt Gullett27-Jul-01 6:30 
GeneralHow can you brush your text in yellow ?? Pin
24-Jul-01 10:25
suss24-Jul-01 10:25 
GeneralRe: How can you brush your text in yellow ?? Pin
Carlos Antollini27-Jul-01 6:26
Carlos Antollini27-Jul-01 6:26 

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.