huayuanview.cpp
void CHuayaunView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
int a=0,b=0,c=0;
if(a<255)
{
a+=50;
if(b<255)
{
b+=50;
if(c<255)
{
c+=50;
CDC *pDC=this->GetDC();
int r=10;
pDC->Ellipse(point.x-r,point.y-r,point.x+r,point.y+r);
CBrush cbrush;
cbrush.CreateSolidBrush(RGB(a,b,c));
pDC->SelectObject(&cbrush);
pDC->Ellipse(point.x-r,point.y-r,point.x+r,point.y+r); //参数分别是左上角坐标,和右下角坐标
cbrush.DeleteObject();}}}
CView::OnLButtonDown(nFlags, point);
}
MFC画圆代码
最新推荐文章于 2021-05-14 09:20:26 发布