Graphics:
CClient dlgDC;//'dlgDC' is the name of the device context
//***Create a pen***
//draws a solid red line of width 2
CPen penRed(PS_SOLID, 2, RGB(255, 0, 0));
CPen *pOldPen = NULL;
//Select a Pen
pOldPen = dlgDC.SelectObject(&penRed);
//***Create a Brush***
//fills with Blue
CBrush brBlue(RGB(0, 0, 255));
CBrush *pOldBrush = NULL;
//select brush
pOldBrush = dlgDC.SelectObject(&brBlue);
//***Draw Shapes***
//Set a Pixel
dlgDC.SetPixel(x, y, RGB(255, 0, 0));
//Draw a line from 'Start Point' to (x, y)
dlgDC.LineTo(x, y);
//Draw a Rectangle
dlgDC.Rectangle(x1, y1, x2, y2);
//Draw a Rectangle with round corners
dlgDC.RoundRect(x1, y1, x2, y2, radius1, radius2);
//Draw Circle
dlgDC.Ellipse(x1, y1, x2, y2);
//Draw a Chord
dlgDC.Chord(x1, y1, x2, y2, line_x1, line_y1, line_x2,
line_y2);
//Move to a spot, can be used with 'LineTo' to create a
'Start Point'
dlgDC.MoveTo(x, y);
Hope this Helps.