MFC编程ellipse()怎么画圆

问题描述:

MFC编程ellipse()怎么画圆
如题,我用MFC想要在固定位置画个圆,要求用ellipse(),比如说左上角坐标是x1,y2,右下角坐标是x2,y2,请问代码该怎么写
1个回答 分类:综合 2014-10-27

问题解答:

我来补答
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)就可以了.
前两个参数为左上角的坐标
后两个参数为右下角的坐标
 
 
展开全文阅读
剩余:2000