MFC编程ellipse()怎么画圆如题,我用MFC想要在固定位置画个圆,要求用ellipse(),比如说左上角坐标是x1,y2,右下角坐标是x2,y2,请问代码该怎么写
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/11 21:56:41
![MFC编程ellipse()怎么画圆如题,我用MFC想要在固定位置画个圆,要求用ellipse(),比如说左上角坐标是x1,y2,右下角坐标是x2,y2,请问代码该怎么写](/uploads/image/z/9310690-10-0.jpg?t=MFC%E7%BC%96%E7%A8%8Bellipse%28%29%E6%80%8E%E4%B9%88%E7%94%BB%E5%9C%86%E5%A6%82%E9%A2%98%2C%E6%88%91%E7%94%A8MFC%E6%83%B3%E8%A6%81%E5%9C%A8%E5%9B%BA%E5%AE%9A%E4%BD%8D%E7%BD%AE%E7%94%BB%E4%B8%AA%E5%9C%86%2C%E8%A6%81%E6%B1%82%E7%94%A8ellipse%EF%BC%88%EF%BC%89%2C%E6%AF%94%E5%A6%82%E8%AF%B4%E5%B7%A6%E4%B8%8A%E8%A7%92%E5%9D%90%E6%A0%87%E6%98%AFx1%2Cy2%2C%E5%8F%B3%E4%B8%8B%E8%A7%92%E5%9D%90%E6%A0%87%E6%98%AFx2%2Cy2%2C%E8%AF%B7%E9%97%AE%E4%BB%A3%E7%A0%81%E8%AF%A5%E6%80%8E%E4%B9%88%E5%86%99)
MFC编程ellipse()怎么画圆如题,我用MFC想要在固定位置画个圆,要求用ellipse(),比如说左上角坐标是x1,y2,右下角坐标是x2,y2,请问代码该怎么写
MFC编程ellipse()怎么画圆
如题,我用MFC想要在固定位置画个圆,要求用ellipse(),比如说左上角坐标是x1,y2,右下角坐标是x2,y2,请问代码该怎么写
MFC编程ellipse()怎么画圆如题,我用MFC想要在固定位置画个圆,要求用ellipse(),比如说左上角坐标是x1,y2,右下角坐标是x2,y2,请问代码该怎么写
CDC::Ellipse
BOOL Ellipse( int x1,int y1,int x2,int y2 );
BOOL Ellipse( LPCRECT lpRect );
Return Value
Nonzero if the function is successful; otherwise 0.
Parameters
x1
Specifies the logical x-coordinate of the upper-left corner of the ellipse’s bounding rectangle.
y1
Specifies the logical y-coordinate of the upper-left corner of the ellipse’s bounding rectangle.
x2
Specifies the logical x-coordinate of the lower-right corner of the ellipse’s bounding rectangle.
y2
Specifies the logical y-coordinate of the lower-right corner of the ellipse’s bounding rectangle.
lpRect
Specifies the ellipse’s bounding rectangle.You can also pass a CRect object for this
所以,直接使用pDC->Ellipse(x1,y1,x2,y2)就可以了.
前两个参数为左上角的坐标
后两个参数为右下角的坐标