属性工具箱资源视图都在视图里面
void CaView::OnDda() { // TODO: 在此添加命令处理程序代码 int x0 = 0, y0 = 0, x1 = 300, y1 = 400, color = 255; //初始坐标(0,0),终止坐标(300,400),颜色为红色 int dx, dy, epsl, k; CClientDC cc(this); float x, y, xIncre, yIncre; dx = x1 - x0; dy = y1 - y0; x = x0; y = x0; if (abs(dx) < abs(dy)) epsl = abs(dx); else epsl = abs(dy); xIncre = (float)dx / (float)epsl; yIncre = (float)dy / (float)epsl; for (k = 0; k <= epsl; k++) { cc.SetPixel(int(x + 0.5), (int)(y + 0.5), color); x += xIncre; y += yIncre; } }