int GetObject( int nCount, LPVOID lpObject ) const;
Return Value
The number of bytes retrieved; otherwise 0 if an error occurs.
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.
Remarks
Fills a buffer with data that defines a specified object. 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.
CGdiObject Overview | Class Members | Hierarchy Chart
See Also CBitmap::GetBitmapBits, CPalette::GetPaletteEntries