# GraffitiImageViewer
Class Inherits GraffitiSuite.BaseCanvas
## About
A beautiful image viewing control that supports zoom, pan, and rotate via gestures.
## Event Definitions
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Dragging | (None) | (None) | Raised when the user is dragging the image using the three-finger gesture. |
| LongPressed | (None) | (None) | Raised when the user has held their finger down in the same spot for one second or longer. |
| PaintBackground | g as Graphics | (None) | Used for drawing the background of the control behind the image. The mask of this drawing operation is used to mask the entire control. |
| PaintForeground | g as Graphics | (None) | Used to draw anything layered above the image. |
| Pressed | (None) | (None) | Raised when the user single-press taps the control. |
| Rotating | (None) | (None) | Raised during rotation operations. |
| Scaling | (None) | (None) | Raised during scaling operations. |
| SwipedDown | (None) | (None) | Raised when the user swipes vertically downward. |
| SwipedLeft | (None) | (None) | Raised when the user swipes horizontally left. |
| SwipedRight | (None) | (None) | Raised when the user swipes horizontally right. |
| SwipedUp | (None) | (None) | Raised when the user swipes vetically upward. |
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Constructor | (None) | (None) |
|
| FlipHorizontal | (None) | (None) | Flip the image horizontally. |
| FlipVertical | (None) | (None) | Flip the image vertically. |
| Reset | (None) | (None) | Resets rotation and scaling. |
| ScaleToFill | (None) | (None) | Scales the image to fill the drawable area. |
| ScaleToFit | (None) | (None) | Scales the image to fit within the drawable area. |
## Shared Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| BitmapForCaching | width as Double <br> height as Double <br> scale as Point | Picture | (None) |
| ColorizeImage | p as Picture <br> c as Color | Picture | (None) |
| DrawGradient | g as Graphics <br> StartColor as Color <br> EndColor as Color <br> Optional TopToBottom as Boolean = True | (None) | (None) |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| DrawGrid | Boolean | (None) | Controls whether the control will draw a grid between the background and image layers. |
| EnableDragMovement | Boolean | (None) | Controls whether the three-finger drag gesture is enabled. |
| EnablePinchRotation | Boolean | (None) | Controls whether the pinch rotation gesture is enabled. |
| EnablePinchZoom | Boolean | (None) | Controls whether the pinch zooming gesture is enabled. |
| EnableSwiping | Boolean | (None) | Controls whether swipe gestures are enabled. |
| GridColor | ColorGroup | (None) | Color used to draw the grid, when enabled. |
| GridSize | Integer | (None) | Approximate point size of the grid squares when enabled. |
| Image | Picture | (None) | Image displayed for user interaction. |
| PositionOffset | Point | (None) | X/Y offset of the image within the display. |
| Rotation | Double | (None) | Rotation angle in degrees. |
| Scale | Double | (None) | Scale of the image drawn in the display. |