Table of Contents

Method DrawAnimatedFocusRect

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

DrawAnimatedFocusRect(SKCanvas, SKRect, SKColor, long, float, float, float, float, bool, bool)

Convenience helper that animates the dash phase to produce the "marching ants" effect. Call this from your paint loop and pass a time value (e.g. milliseconds). Uses CreateFocusRectPaint internally.

public static void DrawAnimatedFocusRect(SKCanvas canvas, SKRect rect, SKColor color, long timeMs, float strokeWidth = 1, float dashOn = 1, float gap = 1, float periodMs = 250, bool useXorBlend = true, bool antialiasing = false)

Parameters

canvas SKCanvas

Target canvas.

rect SKRect

Rectangle in canvas coordinates.

color SKColor

Stroke color.

timeMs long

Elapsed time in milliseconds (used to compute animated phase).

strokeWidth float

Stroke width.

dashOn float

Dash "on" length.

gap float

Dash "off" length.

periodMs float

Period in milliseconds for one full dash-cycle shift (smaller -> faster animation).

useXorBlend bool

Whether to use XOR blend mode.

antialiasing bool

Whether to enable antialiasing.