Code:
hdc = BeginPaint (hwnd, &ps) ;
marks = CreatePen (PS_INSIDEFRAME, 1, 0) ; // create pen for drawing the marks
axis = CreatePen (PS_SOLID, 4, 0) ; // create pen for drawing axis
SelectObject (hdc, marks) ;
xspace = cxClient/20 ;//to find spacing on x axis
yspace = cyClient/20 ;//to find spacing on the X axis
n = 1 ;
while(n<20){
xmarks = xspace * n ; //calculate the position of x marks
ymarks = yspace * n ; // calculate the position of y marks
MoveToEx(hdc, xmarks, 0, NULL) ;//move to starting point of x marks
LineTo(hdc, xmarks, cyClient) ;//draw x marks
MoveToEx(hdc, 0, ymarks, NULL) ;//move to starting point of y marks
LineTo(hdc, cxClient, ymarks) ;//draw y marks
n++ ;
}
SelectObject (hdc, axis) ;
yaxis = cyClient/2 ; //to find half the hieght
xaxis = cxClient/2 ; //to find half the width
MoveToEx(hdc, xaxis, 0, NULL) ; //to move to top of Y axis
LineTo(hdc, xaxis, cyClient) ; //to draw y axis
MoveToEx(hdc, 0, yaxis, NULL) ; //to move to left of X axis
LineTo(hdc, cxClient, yaxis) ; //to draw X axis
SelectObject (hdc, NULL) ;
DeleteObject(axis) ;
DeleteObject(marks) ;
BitBlt(hdc, 0, 0, clientWidth, clientHeight, memhdc, 0, 0, SRCCOPY) ;
EndPaint (hwnd, &ps) ;
break ;
is that what you wanted?