已知2点绘制射线

void DrawLineEx(HDC hdc, RECT &client_rect,RECT &rect) { MoveToEx(hdc,rect.left,rect.top,NULL); LineTo(hdc,rect.right,rect.bottom); RECT nrt=rect; RECT nrt1=rect; float xl=(rect.right-rect.bottom)/(rect.bottom-rect.top); //do //{ OffsetRect(&nrt,20*(nrt.left-nrt.right),20*(nrt.top-nrt.bottom)); //}while(nrt.left>0 || nrt.top>0); nrt1.left=nrt.left; nrt1.top=nrt.top; nrt=rect; //do //{ OffsetRect(&nrt,20*(nrt.right-nrt.left),20*(nrt.bottom-nrt.top)); nrt1.right=nrt.right; nrt1.bottom=nrt.bottom; MoveToEx(hdc,nrt1.left,nrt1.top,NULL); LineTo(hdc,nrt1.right,nrt1.bottom); //}while(nrt.left

你可能感兴趣的:(图形/图像处理)