Originally posted by: Anil Sharma
Thanks a lot.
ReplyOriginally posted by: Ed
When passing a COLORREF be sure it was created with a PALETTERGB rather than an RGB. Failure to do so, will not make images transparent on 8-bit systems (and bitmaps), especially if the color is not in the default palette. I wrestled with this one for a long time before finding PALETTERGB in the MSDN documentation.
Reply
Originally posted by: Robin Grey
I try to improve performance of my application, so i use bitmaps of embedded controls while they are in inactive state. For rich-text control i used rich-edit control ver 1.0 via MFC CRichEditCtrl and CWnd::PrintClient(dc) to get bitmap. All work fine with RE 1.0, but RE 2.0 use some "features" and turn output black during PrintClient()
i was intended to use CRichEditCtrl::FormatRange and CRichEditCtrl::DisplayBand as for printer DC,
works fine with both versions.
but when creating RE 2.0 with WS_EX_TRANSPARENT, previous bug is pop up again :(
if you know some about how RE 2.0 draw itself and some tips, please answer
ReplyOriginally posted by: Raghav Sabbella
Hey,
Is there any way I can get the code for "drawing bitmap transparently". I can't use MFC.
Really appreciate
Thnaks
Raghav
ReplyOriginally posted by: Leandro Gustavo Biss Becker
CDC dc, memDC, maskDC, tempDC;
// rest of source ...
I have problem with uninitialized area. The output area
have been damaged. Look to the beginning of code:
dc.Attach( hdcDest );
maskDC.CreateCompatibleDC(&dc);
CBitmap maskBitmap;
//add these to store return of SelectObject() calls
CBitmap* pOldMemBmp = NULL;
CBitmap* pOldMaskBmp = NULL;
HBITMAP hOldTempBmp = NULL;
memDC.CreateCompatibleDC(&dc);
tempDC.CreateCompatibleDC(&dc);
CBitmap bmpImage;
bmpImage.CreateCompatibleBitmap( &dc, nWidth, nHeight );
pOldMemBmp = memDC.SelectObject( &bmpImage );
hOldTempBmp = (HBITMAP) ::SelectObject( tempDC.m_hDC, hBitmap );
//changed here
//{
//copy to memDC the color of hdcDest background
memDC.BitBlt( 0,0,nWidth, nHeight, &dc, nXDest, nYDest, SRCCOPY )
//}
Originally posted by: Charlie Curtis
To control the SpinEditControl I did the following:
void CUserInputDlg::OnUpdatePrioryearsedit()
// Did it this way so the return value is the Current Year. Didn't want to have to change this each year!
I am looking for any help now that the radio buttons are disabled/enabled as I want as a group. How can I
make the radio (if checked) go to the unchecked state? I have played with it in the above function, but can't
seem to get the currently checked radio!
Any help! is appreciated!
Thanks and hope this helps someone else!
Charlie
I added
EnableDlgGroup(IDC_SIXDIGITRADIO, FALSE);
to the OnInitDialog() which disables my Radio buttons at startup.
{
int theEditBoxYear=0;
theEditBoxYear=(int)m_YearSelected.GetValue();
// Case has to be a constant! So I am forcing it!
if(theEditBoxYear == theCurrentYear)
{
theEditBoxYear = 0;
}
// If it is the Current year (1999) then I do NOT want the user having access to the Radio buttons!
switch(theEditBoxYear)
{
case 0:
EnableDlgGroup(IDC_SIXDIGITRADIO, FALSE);
break;
default:
EnableDlgGroup(IDC_SIXDIGITRADIO, TRUE);
break;
}
}
I know this is a biut crude but I am learning as I go!
Originally posted by: Debs
Thanks SO much for your clear and descriptive explainationof
transparent bitmaps. I was fighting this all afternoon!
thank-you thank-you thank-you!!!!!!!!!!!!!