Click here to Skip to main content
16,016,192 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: AfxGetMainWnd() from a Worker Thread Pin
Giles12-Mar-02 12:26
Giles12-Mar-02 12:26 
GeneralCObArray - Destructors for CObject Pin
dazinith11-Mar-02 10:36
dazinith11-Mar-02 10:36 
GeneralODBC and ExecuteSQL Pin
Yousuf11-Mar-02 10:04
Yousuf11-Mar-02 10:04 
GeneralRe: ODBC and ExecuteSQL Pin
Carlos Antollini11-Mar-02 10:46
Carlos Antollini11-Mar-02 10:46 
GeneralRe: ODBC and ExecuteSQL Pin
Yousuf12-Mar-02 9:21
Yousuf12-Mar-02 9:21 
GeneralWhich software updates NT to MSVCRT.DLL (6.00.8797) Pin
Hoang Le11-Mar-02 9:05
Hoang Le11-Mar-02 9:05 
GeneralRe: Which software updates NT to MSVCRT.DLL (6.00.8797) Pin
Derek Waters11-Mar-02 11:28
Derek Waters11-Mar-02 11:28 
GeneralTransparency and IPicture Pin
Derek Lakin11-Mar-02 8:46
Derek Lakin11-Mar-02 8:46 
I have a wrapper around the IPicture interface for drawing Gifs and jpegs that it is then used in an extended CStatic class. The code below shows the wrapper Render function which is called from the CStatic-derived OnPaint handler (also shown):

// m_pict is a CPictureSSL
void CPictureCtrlSSL::OnPaint()
{
	CPaintDC dc(this);
	if (m_pict) {
		CRect rcClient;
		GetClientRect(&rcClient);
		CRect rcImage(CPoint(0,0),m_pict.GetImageSize());
		CRect rc;
		rc.IntersectRect(&rcImage, &rcClient);
		m_pict.Render(&dc, rc);
	}
}

// m_spIPicture is an ATL smart pointer to IPicture
BOOL CPictureSSL::Render(CDC* pDC, CRect rc, LPCRECT prcMFBounds) const
{
   ASSERT(pDC);

   if (rc.IsRectNull()) {
      CSize sz = GetImageSize(pDC);
      rc.right = sz.cx;
      rc.bottom = sz.cy;
   }
   long hmWidth,hmHeight; // HIMETRIC units
   GetHIMETRICSize(hmWidth, hmHeight);
   m_spIPicture->Render(*pDC, rc.left, rc.top, rc.Width(), rc.Height(),
      0, hmHeight, hmWidth, -hmHeight, prcMFBounds);

   return TRUE;
}


This all works fine, my question is: How can I get the CPictureSSL::Render function to paint a specified colour as transparent? I though if I did m_spIPicture->Render() to a different DC I could then do the necessary bit blits to get the right effect, but I don't know enough to make it work. Any ideas?

Derek Lakin.

I wish I was what I thought I was when I wished I was what I am.

Salamander Software Ltd.
GeneralSIMPLE QUESTION Pin
11-Mar-02 8:20
suss11-Mar-02 8:20 
GeneralRe: SIMPLE QUESTION Pin
Christian Graus11-Mar-02 8:23
protectorChristian Graus11-Mar-02 8:23 
GeneralRe: SIMPLE QUESTION Pin
Mazdak11-Mar-02 9:14
Mazdak11-Mar-02 9:14 
GeneralEdit Boxes\ Rich Edit Pin
11-Mar-02 8:18
suss11-Mar-02 8:18 
GeneralRe: Edit Boxes\ Rich Edit Pin
Christian Graus11-Mar-02 8:24
protectorChristian Graus11-Mar-02 8:24 
GeneralMetafiles (Scaling and Offseting) Pin
MikeG11-Mar-02 7:53
MikeG11-Mar-02 7:53 
GeneralRe: Metafiles (Scaling and Offseting) Pin
Paul M Watt11-Mar-02 8:44
mentorPaul M Watt11-Mar-02 8:44 
GeneralVC.NET and Winforms Pin
DaveJF11-Mar-02 7:26
DaveJF11-Mar-02 7:26 
GeneralAccessing the manufacturer name of a hard drive Pin
Zindine11-Mar-02 7:20
Zindine11-Mar-02 7:20 
GeneralRe: Accessing the manufacturer name of a hard drive Pin
Tim Smith11-Mar-02 7:29
Tim Smith11-Mar-02 7:29 
Generalaccessing members variables/function from within a thread Pin
Merle Pittman11-Mar-02 7:02
Merle Pittman11-Mar-02 7:02 
GeneralRe: accessing members variables/function from within a thread Pin
Joaquín M López Muñoz11-Mar-02 7:19
Joaquín M López Muñoz11-Mar-02 7:19 
GeneralRe: accessing members variables/function from within a thread Pin
Merle Pittman11-Mar-02 7:36
Merle Pittman11-Mar-02 7:36 
GeneralUsing HTMLView with HTML resources Pin
Aaron Schaefer11-Mar-02 6:57
Aaron Schaefer11-Mar-02 6:57 
GeneralRe: Using HTMLView with HTML resources Pin
Mazdak11-Mar-02 7:00
Mazdak11-Mar-02 7:00 
GeneralRe: Using HTMLView with HTML resources Pin
Michael Dunn11-Mar-02 7:14
sitebuilderMichael Dunn11-Mar-02 7:14 
GeneralRe: Using HTMLView with HTML resources Pin
pba_11-Mar-02 7:15
pba_11-Mar-02 7:15 

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.