Link to home
Start Free TrialLog in
Avatar of alexatsearidge
alexatsearidgeFlag for Canada

asked on

drawing a partially transparent brush or region

Currently I am drawing a solid triangle with the following code onto a bitmap.  I need a way to make the triangle partially transparent.  Not sure weather I can do some sort of an alphablend, or use a differnet brush or apply something to the region or rectangle.  Following is my code:
void CIMD_Radar_Map_Dlg::DrawCameraArea()
{
	CRgn   rgnA;
 
	CPoint ptVertex[5];
 
	ptVertex[0].x = m_cam_triangle_X1;
	ptVertex[0].y = m_cam_triangle_Y1;
	ptVertex[1].x = m_cam_triangle_X2;
	ptVertex[1].y = m_cam_triangle_Y2;
	ptVertex[2].x = m_cam_triangle_X3;
	ptVertex[2].y = m_cam_triangle_Y3;
 
	VERIFY(rgnA.CreatePolygonRgn( ptVertex, 3, ALTERNATE));
 
	CRect rectRgnBox;
	int nRgnBoxResult = rgnA.GetRgnBox( &rectRgnBox );
	ASSERT( nRgnBoxResult != ERROR || nRgnBoxResult != NULLREGION );
 
	CBrush brA;
	VERIFY(brA.CreateSolidBrush( RGB(115, 125, 50) ));  // rgnA Red
	VERIFY(m_tempDC.FrameRgn( &rgnA, &brA, 100, 100 ));
}

Open in new window

Avatar of jkr
jkr
Flag of Germany image

Take a look at http://www.codeproject.com/KB/dialog/cdialogsk.aspx ("
CDialogSK - A Skinnable Dialog Class"): "make any one color transparent so that you can see through regions of the dialog"
U, I am not quite sure why you want to delete a question just because you didn't wnat to get back at it in time.
ASKER CERTIFIED SOLUTION
Avatar of alexatsearidge
alexatsearidge
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial