Share via


Gdi::SelectObject_I

This method selects an object into a specified device context. The new object replaces the previous object of the same type.

static WINGDIAPI HGDIOBJ WINAPI SelectObject_I(
  HDC hdc,
  HGDIOBJ hgdiobj
);

Parameters

Return Values

If the selected object is not a region, the handle of the object being replaced indicates success. The following table shows the values that indicate success if the selected object is a region.

Value Description
SIMPLEREGION Region consists of a single rectangle.
COMPLEXREGION Region consists of more than one rectangle.
NULLREGION Region is empty.

NULL indicates that an error occurred and the selected object is not a region. Otherwise, a GDI_ERROR value is returned.

Remarks

This method is an internal version of the SelectObject function.

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 the application has finished drawing with the new object.

An application cannot select a bitmap into more than one device context at a time.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Gdi.hpp.

See Also

CreateDIBSection | SelectObject | Gdi::CombineRgn_I | Gdi::CreateBitmap_I | Gdi::CreateCompatibleBitmap_I | Gdi::CreateDIBPatternBrushPt_I | Gdi::CreateFontIndirectW_I | Gdi::CreatePatternBrush_I | Gdi::CreatePen_I | Gdi::CreatePenIndirect_I | Gdi::CreateRectRgn_I | Gdi::CreateRectRgnIndirect_I | Gdi::CreateSolidBrush_I | Gdi::SelectClipRgn_I

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.