SelectObject使用有些疑问,求解答。

asdasdasdasdaaaaaa 2014-12-31 11:05:44
SelectObject是否是将画刷句柄保存在设备环境句柄中?也就是说如果不重置画刷设备环境上下文始终使用的都是同一个画刷?
...全文
98 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
fly_dragon_fly 2014-12-31
  • 打赏
  • 举报
回复
是的,显然楼上没有回答你的问题
赵4老师 2014-12-31
  • 打赏
  • 举报
回复
SelectObject The SelectObject function selects an object into the specified device context. The new object replaces the previous object of the same type. HGDIOBJ SelectObject( HDC hdc, // handle to device context HGDIOBJ hgdiobj // handle to object ); Parameters hdc Handle to the device context. hgdiobj Handle to the object to be selected. The specified object must have been created by using one of the following functions: Object Functions Bitmap CreateBitmap, CreateBitmapIndirect, CreateCompatibleBitmap, CreateDIBitmap, CreateDIBSection (Bitmaps can be selected for memory device contexts only, and for only one device context at a time.) Brush CreateBrushIndirect, CreateDIBPatternBrush, CreateDIBPatternBrushPt, CreateHatchBrush, CreatePatternBrush, CreateSolidBrush Font CreateFont, CreateFontIndirect Pen CreatePen, CreatePenIndirect Region CombineRgn, CreateEllipticRgn, CreateEllipticRgnIndirect, CreatePolygonRgn, CreateRectRgn, CreateRectRgnIndirect Return Values If the selected object is not a region and the function succeeds, the return value is the handle of the object being replaced. If the selected object is a region and the function succeeds, the return value is one of the following values: Value Meaning SIMPLEREGION Region consists of a single rectangle. COMPLEXREGION Region consists of more than one rectangle. NULLREGION Region is empty. If an error occurs and the selected object is not a region, the return value is NULL. Otherwise, it is GDI_ERROR. Remarks This function returns the previously selected object of the specified type. An application should always replace a new object with the original, default object after it has finished drawing with the new object. An application cannot select a bitmap into more than one device context at a time. ICM: If the object being selected is a brush or a pen color management is performed. QuickInfo Windows NT: Requires version 3.1 or later. Windows: Requires Windows 95 or later. Windows CE: Requires version 1.0 or later. Header: Declared in wingdi.h. Import Library: Use gdi32.lib. See Also Device Contexts Overview, Device Context Functions, CombineRgn, CreateBitmap, CreateBitmapIndirect, CreateBrushIndirect, CreateCompatibleBitmap, CreateDIBitmap, CreateDIBPatternBrush, CreateEllipticRgn, CreateEllipticRgnIndirect, CreateFont, CreateFontIndirect, CreateHatchBrush, CreatePatternBrush, CreatePen, CreatePenIndirect, CreatePolygonRgn, CreateRectRgn, CreateRectRgnIndirect, CreateSolidBrush, SelectClipRgn, SelectPalette
赵4老师 2014-12-31
  • 打赏
  • 举报
回复
引用 4 楼 fly_dragon_fly 的回复:
[quote=引用 3 楼 zhao4zhong1 的回复:] [quote=引用 2 楼 fly_dragon_fly 的回复:] 是的,显然楼上没有回答你的问题
这是我回答问题的个人风格。[/quote] 只想回答2个字的, 论坛要6个字,没办法[/quote] 选中2个子,将其颜色设置为黑色。
fly_dragon_fly 2014-12-31
  • 打赏
  • 举报
回复
引用 3 楼 zhao4zhong1 的回复:
[quote=引用 2 楼 fly_dragon_fly 的回复:] 是的,显然楼上没有回答你的问题
这是我回答问题的个人风格。[/quote] 只想回答2个字的, 论坛要6个字,没办法
赵4老师 2014-12-31
  • 打赏
  • 举报
回复
引用 2 楼 fly_dragon_fly 的回复:
是的,显然楼上没有回答你的问题
这是我回答问题的个人风格。

69,382

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧