Can someone help me wif CBrush and CPen
I've declared and created the brush and pen of bright color, but when i draw the line, it's still in black. Is there any problem with the codes? thanx alot.
if (m_Drag && PointOrigin!=point) // for mouse drag check
{
// Graphics
CClientDC ClientDC(this);
ClientDC.SetROP2(R2_NOT);
CPen SolidPen (PS_SOLID, 1, RGB(0,255,255));
CPen *OldPen;
OldPen = ClientDC.SelectObject(&SolidPen);
//Declare and create the brush
CBrush newBrush;
newBrush.CreateSolidBrush( RGB(0, 255, 255));
CBrush *pBrushSv = ClientDC.SelectObject( &newBrush);
//Arrow
if (MotionFix && dline==1)
DrawLine(&ClientDC,PointOrigin,PointOld);
//check if "line" radio button clicked
if(dline==1)
{
MotionFix=1;
// MotionFix is used to prevent redrawing
DrawLine(&ClientDC,PointOrigin,point);
}
|