www.pudn.com > assigment1.zip > draws.cpp
#include#include "Draws.h" CGraph::CGraph(CWnd *cp) : CClientDC(cp) { } void CDraws::lineDDA(int xa, int ya, int xb, int yb, COLORREF color) { int dx=xb-xa, dy=yb-ya,steps,k; float xIncrement,yIncrement,x=(float)xa,y=(float)ya; if(abs(dx)>abs(dy)) steps = abs(dx); else steps=abs(dy); xIncrement = dx/(float)steps; yIncrement = dy/(float)steps; SetPixel(ROUND(x),ROUND(y),color); for(k=0;k