Share via


Gdi::GetObjectW_I (Windows Embedded CE 6.0)

1/6/2010

This method obtains information about a specified graphics object. Depending on the graphics object, the method places a filled-in BITMAP, DIBSECTION, LOGBRUSH, LOGFONT, or LOGPEN structure into a specified buffer.

Syntax

static WINGDIAPI int WINAPI GetObjectW_I(
  HGDIOBJ hgdiobj,
  int cbBuffer,
  void* lpvObject
);

Parameters

  • hgdiobj
    [in] Handle to the graphics object of interest.

    This handle can be a handle to one of the following:

    • A logical bitmap
    • A brush
    • A font
    • A palette
    • A pen
    • A device-independent bitmap created by calling the CreateDIBSection function
  • cbBuffer
    [in] Integer that specifies the number of bytes of information to be written to the buffer.
  • lpvObject
    [out] Long pointer to a buffer that is to receive 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 type Data written to *lpvObject

    HBITMAP

    BITMAP

    HBITMAP returned from a call to CreateDIBSection

    DIBSECTION, if cbBuffer is set to sizeof(DIBSECTION), or BITMAP, if cbBuffer is set to sizeof(BITMAP)

    HPALETTE

    A WORD count of the number of entries in the logical palette

    HPEN

    LOGPEN

    HBRUSH

    LOGBRUSH

    HFONT

    LOGFONT

    If the lpvObject parameter is NULL, the return value for the method is the number of bytes required to store the information that the method 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 method stores into the buffer.

If the function fails, the return value is zero.

To get extended error information, call GetLastError.

Remarks

This method is an internal version of the GetObject function.

The buffer pointed to by the lpvObject parameter must be sufficiently large to receive the information about the graphics object.

If hgdiobj identifies a bitmap created by calling CreateDIBSection, and the specified buffer is large enough, the Gdi::GetObjectW_I method returns a DIBSECTION structure. In addition, the bmBits member of the BITMAP structure contained within DIBSECTION contains a pointer to the bit values for the bitmap.

If hgdiobj identifies a bitmap created by any other means, Gdi::GetObjectW_I returns only the width, height, and color format information of the bitmap.

If hgdiobj identifies a logical palette, Gdi::GetObjectW_I 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 Gdi::GetPaletteEntries_I method.

Requirements

Header gdi.hpp
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

Gdi
CreateDIBSection
GetObject
Gdi::GetPaletteEntries_I
Gdi::GetRegionData_I
BITMAP
DIBSECTION
LOGBRUSH
LOGPALETTE
LOGPEN

Other Resources

LOGFONT