diff --git a/docs/docs/sksignaturepadview.md b/docs/docs/sksignaturepadview.md new file mode 100644 index 00000000..19d3cb04 --- /dev/null +++ b/docs/docs/sksignaturepadview.md @@ -0,0 +1,132 @@ +# SKSignaturePadView + +The signature pad view provides fluid, pressure-sensitive ink rendering for capturing signatures or handwritten input. It supports stylus/pen pressure for variable stroke width (harder pressure = thicker lines) and uses quadratic Bezier curves to smooth jagged input from finger or pen movement. + +## Properties + +The main properties of a signature pad view are: + +| Property | Type | Description | +| :--------------------- | :-------- | :---------- | +| **StrokeColor** | `Color` | The color of the ink strokes. Default is `Black`. | +| **MinStrokeWidth** | `float` | The minimum stroke width at zero pressure. Default is `1`. | +| **MaxStrokeWidth** | `float` | The maximum stroke width at full pressure. Default is `8`. | +| **PadBackgroundColor** | `Color` | The background color of the signature pad. Default is `White`. | +| **IsBlank** | `bool` | A read-only value indicating whether the pad has no strokes. | +| **StrokeCount** | `int` | The number of strokes on the signature pad. | + +## Methods + +The signature pad provides several methods for manipulating and exporting signatures: + +| Method | Return Type | Description | +| :----------- | :---------- | :---------- | +| **Clear()** | `void` | Clears all strokes from the signature pad. | +| **Undo()** | `bool` | Removes the last stroke. Returns `true` if a stroke was removed. | +| **ToPath()** | `SKPath?` | Gets a combined path of all strokes. Returns `null` if blank. | +| **ToImage(int width, int height, SKColor? backgroundColor)** | `SKImage?` | Renders the signature to an image with the specified dimensions. | +| **GetStrokeBounds()** | `SKRect` | Gets the bounding rectangle of all strokes. | + +## Events + +| Event | Type | Description | +| :------------------ | :-------------------------------------------- | :---------- | +| **Cleared** | `EventHandler` | Raised when all strokes are cleared. | +| **StrokeCompleted** | `EventHandler` | Raised when a stroke is completed. | + +## Commands + +| Command | Description | +| :---------------------------- | :---------- | +| **ClearedCommand** | Executed when strokes are cleared. | +| **ClearedCommandParameter** | Parameter passed to the ClearedCommand. | +| **StrokeCompletedCommand** | Executed when a stroke is completed. | +| **StrokeCompletedCommandParameter** | Parameter passed to the StrokeCompletedCommand. | + +## Parts + +The default template uses an SKCanvasView for rendering: + +```xaml + + + +``` + +| Part | Description | +| :----------------------- | :---------- | +| **PART_DrawingSurface** | This part can either be a `SKCanvasView` or a `SKGLView` and describes the actual rendering surface for the signature. | + +## Usage + +### Basic Usage + +```xaml + +``` + +### With Commands + +```xaml + + +