Table of Contents

Method Paint

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

Paint(nint, SKRectI, SKSizeI, SKColor, Action<SKSurface, SKRectI>)

Renders content to the specified target device context within the given clipping region.

public void Paint(nint hdcTarget, SKRectI clip, SKSizeI clientSize, SKColor clearColor, Action<SKSurface, SKRectI> drawAction)

Parameters

hdcTarget nint

The handle to the device context (HDC) where the content will be rendered.

clip SKRectI

The rectangular region of the target to which rendering is restricted. If empty, the entire client area is used.

clientSize SKSizeI

The size of the client area, in pixels, used to determine the rendering surface dimensions.

clearColor SKColor

The color used to clear the clipping region before drawing. If SKColors.Transparent, no clearing is performed.

drawAction Action<SKSurface, SKRectI>

A callback action that performs the actual drawing on the rendering surface. The callback receives the SKSurface to draw on and the clipping region as a SKRectI.

Remarks

This method prepares a rendering surface, applies the specified clipping region, clears the region with the provided color if necessary, and invokes the drawAction to perform custom drawing. After drawing, the rendered content is copied to the target device context.