网站首页  词典首页

请输入您要查询的函数:

 

术语 getobject
释义 GetObject
语法:
int GetObject(
__in HGDIOBJ hgdiobj,
__in int cbBuffer,
__out LPVOID lpvObject
);
GetObject函数
GetObject函数检索指定的图形信息的对象。
参数
hgdiobj [in]
一个句柄,图形感兴趣的对象。这可以是一个句柄下列之一:一个逻辑位图,画笔,字体,调色板,一支笔,或一个设备独立位图通过调用CreateDIBSection函数创建。
cbBuffer [in]
在数字节的信息被写入到缓冲区。
lpvObject [out]
阿一个缓冲区,它接收有关指定图形信息的指针对象。
下表显示的信息类型的缓冲区的图形的每个类型的接收对象,您可以指定与hgdiobj。
对象typeData写入缓冲区
HBITMAPBITMAP
HBITMAP返回的调用CreateDIBSection DIBSECTION,如果cbBuffer设置为sizeof(DIBSECTION),或位图,如果cbBuffer设置为sizeof(位图)。
HPALETTEA字数的条目的数量逻辑调色板
HPEN归来呼吁ExtCreatePen EXTLOGPEN
HPENLOGPEN
HBRUSHLOGBRUSH
HFONTLOGFONT
如果lpvObject参数为NULL,函数返回值是所需要的存储资料写入指定的图形对象缓冲区的字节数。
返回值
如果函数成功,并lpvObject是一个有效的指针,返回值是存储到缓冲区的字节数。
如果函数成功,并lpvObject为NULL,则返回值是须持有资料的功能将存储到缓冲区的字节数。
如果函数失败,返回值是零。
备注
缓冲区指出的lpvObject参数必须足够大,以获得有关信息的图形对象。根据不同的图形对象,函数使用一个位图,DIBSECTION,EXTLOGPEN,LOGBRUSH,逻辑字体,或LOGPEN结构,或表项数(为一个逻辑调色板)。
如果hgdiobj是一个句柄,通过调用CreateDIBSection创建了一个位图,并且指定的缓冲区足够大,GetObject函数返回一个DIBSECTION结构。此外,位图的结构bmBits成员包含在DIBSECTION将包含一个指向位图的位值。
如果hgdiobj是一个句柄以任何其他方式创建了一个位图,GetObject将返回只有宽度,高度和颜色位图格式的信息。您可以通过调用GetDIBits或GetBitmapBits函数位图的位值。
如果hgdiobj是一个句柄逻辑调色板,则GetObject检索一个2字节的整数,指定调色板中的条目数量。该函数不检索LOGPALETTE结构定义调色板。检索有关调色板项的信息,应用程序可以调用GetPaletteEntries功能。
如果hgdiobj是字体句柄,返回的逻辑字体用于创建的逻辑字体的字体。如果Windows不得不作出某些字体插值精确逻辑字体,因为不能代表插值将不会反映在逻辑字体。例如,如果您的字体,不支持垂直画垂直版本要求的逻辑字体显示的字体是垂直的,但它的Windows将油漆Level。
实例
有关示例,请参阅存储的图像。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
Unicode和ANSI namesGetObjectW(Unicode)和GetObjectA(ANSI)的
参见
设备上下文概述
设备上下文函数
CreateDIBSection
GetBitmapBits
GetDIBits
GetPaletteEntries
GetRegionData
位图
DIBSECTION
EXTLOGPEN
LOGBRUSH
逻辑字体
LOGPALETTE
LOGPEN
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GetObject Function
The GetObject function retrieves information for the specified graphics object.
Syntax
int GetObject(
__in HGDIOBJ hgdiobj,
__in int cbBuffer,
__out LPVOID lpvObject
);
Parameters
hgdiobj [in]
A handle to the graphics object of interest. This can be a handle to one of the following: a logical bitmap, a brush, a font, a palette, a pen, or a device independent bitmap created by calling the CreateDIBSection function.
cbBuffer [in]
The number of bytes of information to be written to the buffer.
lpvObject [out]
A pointer to a buffer that receives the information about the specified graphics object.
The following table shows the type of information the buffer receives for each type of graphics object you can specify with hgdiobj.
Object typeData written to buffer
HBITMAPBITMAP
HBITMAP returned from a call to CreateDIBSection DIBSECTION , if cbBuffer is set to sizeof (DIBSECTION), or BITMAP , if cbBuffer is set to sizeof (BITMAP).
HPALETTEA WORD count of the number of entries in the logical palette
HPEN returned from a call to ExtCreatePen EXTLOGPEN
HPENLOGPEN
HBRUSHLOGBRUSH
HFONTLOGFONT

If the lpvObject parameter is NULL, the function return value is the number of bytes required to store the information it writes to the buffer for the specified graphics object.
Return Value
If the function succeeds, and lpvObject is a valid pointer, the return value is the number of bytes stored into the buffer.
If the function succeeds, and lpvObject is NULL, the return value is the number of bytes required to hold the information the function would store into the buffer.
If the function fails, the return value is zero.
Remarks
The buffer pointed to by the lpvObject parameter must be sufficiently large to receive the information about the graphics object. Depending on the graphics object, the function uses a BITMAP, DIBSECTION, EXTLOGPEN, LOGBRUSH, LOGFONT, or LOGPEN structure, or a count of table entries (for a logical palette).
If hgdiobj is a handle to a bitmap created by calling CreateDIBSection, and the specified buffer is large enough, the GetObject function returns a DIBSECTION structure. In addition, the bmBits member of the BITMAP structure contained within the DIBSECTION will contain a pointer to the bitmap's bit values.
If hgdiobj is a handle to a bitmap created by any other means, GetObject returns only the width, height, and color format information of the bitmap. You can obtain the bitmap's bit values by calling the GetDIBits or GetBitmapBits function.
If hgdiobj is a handle to a logical palette, GetObject retrieves a 2-byte integer that specifies the number of entries in the palette. The function does not retrieve the LOGPALETTE structure defining the palette. To retrieve information about palette entries, an application can call the GetPaletteEntries function.
If hgdiobj is a handle to a font, the LOGFONT that is returned is the LOGFONT used to create the font. If Windows had to make some interpolation of the font because the precise LOGFONT could not be represented, the interpolation will not be reflected in the LOGFONT. For example, if you ask for a vertical version of a font that doesn't support vertical painting, the LOGFONT indicates the font is vertical, but Windows will paint it horizontally.
Examples
For an example, see Storing an Image .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
Unicode and ANSI namesGetObjectW (Unicode) and GetObjectA (ANSI)
See Also
Device Contexts Overview
Device Context Functions
CreateDIBSection
GetBitmapBits
GetDIBits
GetPaletteEntries
GetRegionData
BITMAP
DIBSECTION
EXTLOGPEN
LOGBRUSH
LOGFONT
LOGPALETTE
LOGPEN
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144904(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:26:31