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

Programming TheoryPhotos / Graphics SoftwareC++

Avatar of undefined
Last Comment

8/22/2022 - Mon

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.

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes