CGdiObject::GetObject

Fills a buffer with data that defines a specified object.

int GetObject( 
   int nCount, 
   LPVOID lpObject  
) const;

Parameters

  • nCount
    Specifies the number of bytes to copy into the lpObject buffer.

  • lpObject
    Points to a user-supplied buffer that is to receive the information.

Return Value

The number of bytes retrieved; otherwise 0 if an error occurs.

Remarks

The function retrieves a data structure whose type depends on the type of graphic object, as shown by the following list:

Object

Buffer type

CPen

LOGPEN

CBrush

LOGBRUSH

CFont

LOGFONT

CBitmap

BITMAP

CPalette

WORD

CRgn

Not supported

If the object is a CBitmap object, GetObject returns only the width, height, and color format information of the bitmap. The actual bits can be retrieved by using CBitmap::GetBitmapBits.

If the object is a CPalette object, GetObject retrieves a WORD that specifies the number of entries in the palette. The function does not retrieve the LOGPALETTE structure that defines the palette. An application can get information on palette entries by calling CPalette::GetPaletteEntries.

Requirements

Header: afxwin.h

See Also

Reference

CGdiObject Class

Hierarchy Chart

CBitmap::GetBitmapBits

CPalette::GetPaletteEntries