标签:style blog http color 使用 strong
SelectObject
把一个对象(位图、画笔、画刷等)选入指定的设备描述表。新的对象代替同一类型的老对象。
HGDIOBJ SelectObject( HDC hdc, //
handle to DC HGDIOBJ hgdiobj //
handle to object ); |
参数
但该对象的句柄必须使用以下函数创建才有效:
Bitmap(位图) CreateBitmap, CreateBitmapIndirect,
CreateCompatibleBitmap, CreateDIBitmap,
CreateDIBSection
Brush(画刷) CreateBrushIndirect, eateDIBPatternBrush,
CreateDIBPatternBrushPt, CreateHatchBrush,
CreatePatternBrush, CreateSolidBrush
Font(字体) CreateFont, CreateFontIndirect
Pen(画笔) CreatePen, CreatePenIndirect
Region(区域) CombineRgn, CreateEllipticRgn,
CreateEllipticRgnIndirect,
CreatePolygonRgn, CreateRectRgn,
CreateRectRgnIndirect
=======================================================
1、看MSDN中的解释:
Selects an object into the device context(选择一个对象到设备上下文中去).
参数:
A pointer to a CPen object to be selected.
A pointer to a CBrush object to be selected.
A pointer to a CFont object to be selected.
A pointer to a CBitmap object to be selected.
A pointer to a CRgn object to be selected.
A pointer to a CGdiObject object to be selected.
返回值:
A pointer to the object being replaced. This is a pointer to an object of one of the classes derived fromCGdiObject, such as CPen, depending on which version of the function is used.
返回一个指向被代替的对象的指针。这个真正指向的对象是重载于CGdiObject类的一种,比如CPen,具体以来与所使用的函数版本。
2、测试代码
3、运行结果:
SelectObject()函数,布布扣,bubuko.com
标签:style blog http color 使用 strong
原文地址:http://blog.csdn.net/ghevinn/article/details/36388251