网站首页  词典首页

请输入您要查询的函数:

 

术语 selectobject
释义 SelectObject
语法:
HGDIOBJ SelectObject(
__in HDC hdc,
__in HGDIOBJ hgdiobj
);
SelectObject Function
SelectObject函数选择到指定的设备上下文(DC)的对象。新的对象取代了同一类型的一个对象。
参数
hdc [in]
句柄到DC。
hgdiobj [in]
句柄的对象被选中。指定的对象必须是由使用下列功能之一。
ObjectFunctions
BitmapCreateBitmap,CreateBitmapIndirect,CreateCompatibleBitmap,CreateDIBitmap,CreateDIBSection
位图只能选择到内存DC的。一个单一的位图不能选择到多个区在同一时间。
BrushCreateBrushIndirect,CreateDIBPatternBrush,CreateDIBPatternBrushPt,CreateHatchBrush,CreatePatternBrush,CreateSolidBrush
FontCreateFont,CreateFontIndirect
PenCreatePen,CreatePenIndirect
RegionCombineRgn,新建椭圆CreateEllipticRgnIndirect,CreatePolygonRgn,CreateRectRgn,CreateRectRgnIndirect
返回值
如果所选的对象不是一个地区和函数成功,返回值是一个对象的句柄被取代。如果所选的对象是一个地区和函数成功,返回值是下列值之一。
ValueMeaning
SIMPLEREGIONRegion包含一个矩形。
COMPLEXREGIONRegion由多个矩形。
NULLREGIONRegion是空的。
如果出现错误,选定的对象不是一个地区,返回值为NULL。否则,它是HGDI_ERROR。
备注
此函数返回指定类型的先前选定的对象。应用程序应始终代替原来的,新的对象默认对象后,它已经完成了新的对象绘图。
应用程序不能选择一次到多个区一个位图。
ICM的:如果被选中的对象是一个刷子或一支笔,色彩管理是执行。
实例
有关示例,请参阅设置笔或画笔颜色。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
设备上下文概述
设备上下文函数
CombineRgn
CreateBitmap
CreateBitmapIndirect
CreateBrushIndirect
CreateCompatibleBitmap
CreateDIBitmap
CreateDIBPatternBrush
CreateEllipticRgn
CreateEllipticRgnIndirect
CreateFont
CreateFontIndirect
CreateHatchBrush
CreatePatternBrush
CreatePen
CreatePenIndirect
CreatePolygonRgn
CreateRectRgn
CreateRectRgnIndirect
CreateSolidBrush
SelectClipRgn
SelectPalette
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==SelectObject Function
The SelectObject function selects an object into the specified device context (DC). The new object replaces the previous object of the same type.
Syntax
HGDIOBJ SelectObject(
__in HDC hdc,
__in HGDIOBJ hgdiobj
);
Parameters
hdc [in]
A handle to the DC.
hgdiobj [in]
A handle to the object to be selected. The specified object must have been created by using one of the following functions.
ObjectFunctions
BitmapCreateBitmap , CreateBitmapIndirect , CreateCompatibleBitmap , CreateDIBitmap , CreateDIBSection
Bitmaps can only be selected into memory DC's. A single bitmap cannot be selected into more than one DC at the same time.
BrushCreateBrushIndirect , CreateDIBPatternBrush , CreateDIBPatternBrushPt , CreateHatchBrush , CreatePatternBrush , CreateSolidBrush
FontCreateFont , CreateFontIndirect
PenCreatePen , CreatePenIndirect
RegionCombineRgn , CreateEllipticRgn , CreateEllipticRgnIndirect , CreatePolygonRgn , CreateRectRgn , CreateRectRgnIndirect

Return Value
If the selected object is not a region and the function succeeds, the return value is a handle to the object being replaced. If the selected object is a region and the function succeeds, the return value is one of the following values.
ValueMeaning
SIMPLEREGIONRegion consists of a single rectangle.
COMPLEXREGIONRegion consists of more than one rectangle.
NULLREGIONRegion is empty.

If an error occurs and the selected object is not a region, the return value is NULL. Otherwise, it is HGDI_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 single bitmap into more than one DC at a time.
ICM: If the object being selected is a brush or a pen, color management is performed.
Examples
For an example, see Setting the Pen or Brush Color .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
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
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd162957(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:29:07