how to draw transparent rectangle in MFC
-
how to draw transparent rectangle in MFC I have tried using following code but it does not work. int nPrevMode = pDC->SetBkMode(TRANSPARENT); COLORREF bkcolor = pDC->SetBkColor(BLACK); pDC->Rectangle(rect1.left, rect1.top, rect1.right, rect1.bottom);
thanks
-
how to draw transparent rectangle in MFC I have tried using following code but it does not work. int nPrevMode = pDC->SetBkMode(TRANSPARENT); COLORREF bkcolor = pDC->SetBkColor(BLACK); pDC->Rectangle(rect1.left, rect1.top, rect1.right, rect1.bottom);
thanks
Use CDC::FrameRect[^] or use CDC::Rectangle[^] with a NULL_BRUSH[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
how to draw transparent rectangle in MFC I have tried using following code but it does not work. int nPrevMode = pDC->SetBkMode(TRANSPARENT); COLORREF bkcolor = pDC->SetBkColor(BLACK); pDC->Rectangle(rect1.left, rect1.top, rect1.right, rect1.bottom);
thanks
saksp wrote:
does not work.
Define what you expected to happen and what actually happened. I suspect your expectation doesn't match what the documentation promises. The documentation of
SetBkMode
says this:The background mix mode is used with text, hatched brushes, and pen styles that are not solid lines.
Are you using any of those three?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
how to draw transparent rectangle in MFC I have tried using following code but it does not work. int nPrevMode = pDC->SetBkMode(TRANSPARENT); COLORREF bkcolor = pDC->SetBkColor(BLACK); pDC->Rectangle(rect1.left, rect1.top, rect1.right, rect1.bottom);
thanks
-
how to draw transparent rectangle in MFC I have tried using following code but it does not work. int nPrevMode = pDC->SetBkMode(TRANSPARENT); COLORREF bkcolor = pDC->SetBkColor(BLACK); pDC->Rectangle(rect1.left, rect1.top, rect1.right, rect1.bottom);
thanks
good