Method DrawAnimatedFocusRect
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
canvasSKCanvasTarget canvas.
rectSKRectRectangle in canvas coordinates.
colorSKColorStroke color.
timeMslongElapsed time in milliseconds (used to compute animated phase).
strokeWidthfloatStroke width.
dashOnfloatDash "on" length.
gapfloatDash "off" length.
periodMsfloatPeriod in milliseconds for one full dash-cycle shift (smaller -> faster animation).
useXorBlendboolWhether to use XOR blend mode.
antialiasingboolWhether to enable antialiasing.