用vc写C语言程序如何画一个点

用vc写C语言程序如何画一个点,第1张

用下边这个函数,这个函数画出来的真的是一个点,一个局梁像素点。不知道你是要画一个像素点,还是要画一个很大的点???

COLORREF SetPixel(

HDC hdc, // handle to DC

int X, //返腊袜 x-coordinate of pixel

int Y, // y-coordinate of pixel

COLORREF crColor // pixel color

)

画大点就用下边的函数吧,就是画一个椭圆,当然圆是椭圆的一种。这个函数会用当前画刷填充圆饼的,就是一个大点。

BOOL Pie(

HDC hdc, // handle to DC

int nLeftRect, // x-coord of upper-left corner of rectangle

int nTopRect,// y-coord of upper-left corner of rectangle

int nRightRect, // x-coord of lower-right corner of rectangle

int nBottomRect, // y-coord of lower-right corner of rectangle

int nXRadial1, // x-coord of first radial's endpoint

int nYRadial1, // y-coord of first radial'漏激s endpoint

int nXRadial2, // x-coord of second radial's endpoint

int nYRadial2// y-coord of second radial's endpoint

)

CClientDC pdc(this)

pdc.SetPixel(25,25,RGB(255,0,0))//一个红点

CBrush *OldBrush

OldBrush=(CBrush*)pdc.SelectStockObject(NULL_BRUSH)//创建旦滑指一个不填充的画刷

pdc.Ellipse(0,0,50,50)//模配一让运个圆

pdc.SelectObject(OldBrush)

剩下的自己搞啦...


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/12370058.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-24
下一篇 2023-05-24

发表评论

登录后才能评论

评论列表(0条)

保存