Table of Contents

Method SelectObject

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

SelectObject(nint, nint)

Selects an object into the specified device context, replacing the previous object.

public static extern nint SelectObject(nint hdc, nint hgdiobj)

Parameters

hdc nint

A handle to the device context.

hgdiobj nint

A handle to the GDI object to be selected into the device context. This can be a pen, brush, font, bitmap, or other GDI object.

Returns

nint

A handle to the object being replaced in the device context, or Zero if an error occurs.

Remarks

This method is a wrapper for the GDI SelectObject function. The caller is responsible for ensuring that the selected object is compatible with the device context. The previous object returned by this method should be restored to the device context before releasing it to avoid resource leaks.