六种GDI对象,画笔、画刷、位图、区域、字体和调色板。除了调色板之外,这些对象都是通过SelectObject选进设备描述表的。
This function returns the previously selected object of the specified type.
SelectObject将返回设备描述表中上一次选择的对象句柄。
例:
hPen = SelectObject (hdc, CreatePen (PS_DASH, 0, RGB (255, 0, 0))) ; DeleteObject (SelectObject (hdc, hPen)) ;
或许这样写,更清楚一些
hPen = CreatePen(PS_DASH,0,RGB(255,0,0)); hOldPen = SelectObject(hdc,hPen); ```````balbalbalbalbalb`````````````` SelectObject(hdc,hOldPen); DeleteObject(hPen);