Method CreateFocusRectPaint
CreateFocusRectPaint(SKColor, float, float, float, float, bool, bool, SKStrokeCap)
Creates an SKPaint configured to draw a focus-like dashed rectangle (similar to WinForms DrawFocusRectangle). The returned SKPaint must be disposed by the caller.
public static SKPaint CreateFocusRectPaint(SKColor color, float strokeWidth = 1, float dashOn = 1, float gap = 1, float phase = 0, bool useXorBlend = true, bool antialiasing = false, SKStrokeCap strokeCap = SKStrokeCap.Square)
Parameters
colorSKColorPrimary color used for the stroke (when xor==true, result depends on blend and background).
strokeWidthfloatStroke width in canvas units (use 1 for a typical hairline).
dashOnfloatDash "on" length (small value produces dot-like strokes, e.g. 1).
gapfloatDash "off" length (space between dots).
phasefloatDash phase offset (use to create marching-ants animation).
useXorBlendboolIf true, sets paint.BlendMode = SKBlendMode.Xor to try to mimic GDI+ XOR drawing (backend dependent).
antialiasingboolWhether to enable antialiasing for the paint.
strokeCapSKStrokeCapStroke cap to use. Round produces rounded dots for short on-lengths; Square produces rectangular dashes.
Returns
- SKPaint
An SKPaint instance configured for focus-rect drawing. Caller must dispose it.