新闻中心

EEPW首页 > 嵌入式系统 > 设计应用 > 在hellowrold程序基础上绘制一个圆

在hellowrold程序基础上绘制一个圆

作者:时间:2016-09-12来源:网络收藏

只需修改OnPaint方法

本文引用地址:http://www.eepw.com.cn/article/201609/303402.htm

LONG OnPaint(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

{

PAINTSTRUCT ps;

HDC hdc;

RECT rect;

HPEN hpen;

GetClientRect(hWnd,rect);

hdc = BeginPaint(hWnd,ps);

//hpen = GetStockPen(BLACK_PEN); //两种创建画笔的方法

hpen = CreatePen(PS_SOLID,2,RGB(0XFF,0X00,0X00));

HGDIOBJ oldpen = SelectObject(hdc,hpen);

Ellipse(hdc,10,10,200,200);

SelectObject(hdc,oldpen);

DeleteObject(hpen);

EndPaint(hWnd,ps);

return TRUE;

}



关键词: WinCE

评论


相关推荐

技术专区

关闭