I am using Microsoft visual c++ 6, and I want to draw a shape (say a
rectangle) on a view. The code that I have used is below, but this draws a
solid -filled rectangle, what I want is a displayed shape with a
semi-transparent color i.e. we should still be able to see whatever is
beneath the shape. Can anyone help me? Thanks.
void OnPaint()
{
CPaintDC dc(this);
CPen pPen(PS_SOLID, 1, RGB(0,0,0));
CBrush bBr(RGB(0,0,150));
CRect rec;
//rectangle to be drawn
rec.top = 0;
rec.left = 0;
rec.right = 100;
rec.bottom = 100;
dc.SelectObject(pPen);
dc.SelectObject(bBr);
dc.Rectangle(rec);
}