新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 在hellowrold程序基礎(chǔ)上繪制一個圓

在hellowrold程序基礎(chǔ)上繪制一個圓

作者: 時間:2016-09-12 來源:網(wǎng)絡(luò) 收藏

只需修改OnPaint方法

本文引用地址:http://www.butianyuan.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); //兩種創(chuàng)建畫筆的方法

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;

}



關(guān)鍵詞: WinCE

評論


相關(guān)推薦

技術(shù)專區(qū)

關(guān)閉