Class FreehandCreate
Inheritance
System.Object
Windows.UI.Xaml.DependencyObject
Windows.UI.Xaml.UIElement
Windows.UI.Xaml.FrameworkElement
Windows.UI.Xaml.Controls.Panel
Windows.UI.Xaml.Controls.Canvas
FreehandCreate
Implements
Windows.UI.Composition.IAnimationObject
Windows.UI.Composition.IVisualElement
Assembly: pdftron.PDF.Tools.dll
public class FreehandCreate : SimpleShapeCreate, IDependencyObject, IDependencyObject2, IUIElement, IUIElement2, IUIElement3, IUIElement4, IUIElement5, IUIElement7, IUIElement8, IUIElement9, IUIElement10, IUIElementOverrides, IUIElementOverrides7, IUIElementOverrides8, IUIElementOverrides9, IAnimationObject, IVisualElement, IFrameworkElement, IFrameworkElement2, IFrameworkElement3, IFrameworkElement4, IFrameworkElement6, IFrameworkElement7, IFrameworkElementProtected7, IFrameworkElementOverrides, IFrameworkElementOverrides2, IPanel, IPanel2, ICanvas
Constructors
Declaration
public FreehandCreate(PDFViewCtrl ctrl, ToolManager tMan, bool isMarker = false)
Parameters
Type |
Name |
Description |
PDFViewCtrl |
ctrl |
|
ToolManager |
tMan |
|
System.Boolean |
isMarker |
|
Fields
Declaration
public static readonly Color DEFAULT_INK_ERASER_COLOR
Field Value
Type |
Description |
Windows.UI.Color |
|
Declaration
public const double DEFAULT_INK_ERASER_OPACITY = null
Field Value
Type |
Description |
System.Double |
|
Declaration
public const int DEFAULT_INK_PRESET_LABEL_FOR_ERASER = null
Field Value
Type |
Description |
System.Int32 |
|
Declaration
protected bool mAllowDrawingDot
Field Value
Type |
Description |
System.Boolean |
|
Declaration
protected List<FreehandCreate.StrokeCollection> mAllStrokes
Field Value
Declaration
protected double mBottommost
Field Value
Type |
Description |
System.Double |
|
Declaration
protected Path mCurrentPath
Field Value
Type |
Description |
Windows.UI.Xaml.Shapes.Path |
|
Declaration
protected FreehandCreate.PathFigureBuilder mCurrentPathFigure
Field Value
Declaration
protected FreehandCreate.PenStroke mCurrentStroke
Field Value
Declaration
protected FreehandCreate.StrokeCollection mCurrentStrokeSet
Field Value
Declaration
protected SolidColorBrush mEraserColor
Field Value
Type |
Description |
Windows.UI.Xaml.Media.SolidColorBrush |
|
Declaration
protected double mEraserOpacity
Field Value
Type |
Description |
System.Double |
|
Declaration
protected bool mEraserPropertiesSet
Field Value
Type |
Description |
System.Boolean |
|
Declaration
protected bool mEraserStartErasing
Field Value
Type |
Description |
System.Boolean |
|
Declaration
protected FreehandCreate.StrokeCollection mEraserStrokeCollection
Field Value
Declaration
protected double mEraserThickness
Field Value
Type |
Description |
System.Double |
|
Declaration
protected bool mEraseThisInkOnly
Field Value
Type |
Description |
System.Boolean |
|
Declaration
protected bool mFirstTime
Field Value
Type |
Description |
System.Boolean |
|
Declaration
protected FreehandCreate.PenStroke mFullEraserStroke
Field Value
Declaration
Field Value
Type |
Description |
System.Boolean |
|
Declaration
protected Point mLastEndPoit
Field Value
Type |
Description |
pdftron.PDF.Point |
|
Declaration
protected Point mLastErasedPoint
Field Value
Type |
Description |
pdftron.PDF.Point |
|
Declaration
protected Point mLastPoint
Field Value
Type |
Description |
Windows.Foundation.Point |
|
Declaration
protected double mLeftmost
Field Value
Type |
Description |
System.Double |
|
Declaration
protected bool mMultiStrokeMode
Field Value
Type |
Description |
System.Boolean |
|
Declaration
protected bool mMustAddPath
Field Value
Type |
Description |
System.Boolean |
|
Declaration
protected bool mMustCreateNewStroke
Field Value
Type |
Description |
System.Boolean |
|
Declaration
protected FreehandCreate.PenStroke mPartialEraserStroke
Field Value
mRemainInEraserMode
Declaration
protected bool mRemainInEraserMode
Field Value
Type |
Description |
System.Boolean |
|
Declaration
protected double mRightmost
Field Value
Type |
Description |
System.Double |
|
Declaration
protected bool mShapeHasBeenCreated
Field Value
Type |
Description |
System.Boolean |
|
Declaration
protected double mTopmost
Field Value
Type |
Description |
System.Double |
|
Declaration
protected List<FreehandCreate.UndoRedoSnapshot> mUndoneSnapshots
Field Value
Declaration
protected List<FreehandCreate.UndoRedoSnapshot> mUndoSnapshots
Field Value
Properties
Sets whether the Freehand tool will allow dots to be created
or it will block any drawing to a min threshold to start drawing
Declaration
public bool AllowDrawingDot { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Gets the list of all strokes in page space.
Declaration
public List<FreehandCreate.StrokeCollection> AllStrokes { get; }
Property Value
Gets whether or not the ink has any strokes, whether they've been undone or not.
Declaration
public bool HasStrokes { get; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public bool IsEraser { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Gets whether the tool is currently in timed mode, meaning it will wait for a while and combine the next stroke
into one annotation if it is close enough.
Declaration
public bool IsInTimedMode { get; }
Property Value
Type |
Description |
System.Boolean |
|
Gets or sets whether this is a marker
Declaration
public bool IsMarker { get; }
Property Value
Type |
Description |
System.Boolean |
|
Gets or sets whether this is a stylus annotation
Declaration
public bool IsUsingSylus { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Sets whether the tool will push back each stroke once the pointer is released,
or if it should continue to accumulate strokes until the user explicitly says it's done
When done, call CommitAnnotation()
Declaration
public bool MultiStrokeMode { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Gets or sets whether ink should be saved when the PDFViewCtrl is zoomed or resized or it's layout is otherwise changed.
Declaration
public bool RetainInkWhenScalingOrSizing { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Gets or set whether ink should be saved if the tool is closed
Declaration
public bool SaveInkOnClose { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
Declaration
protected void AddPointToPath(Point cnPoint, bool smooth = true)
Parameters
Type |
Name |
Description |
Windows.Foundation.Point |
cnPoint |
|
System.Boolean |
smooth |
|
Declaration
protected void AddToolToCanvasIfNeeded()
Declaration
protected bool ApplyEraser(IReadOnlyCollection<Point> eraserPagePoints)
Parameters
Type |
Name |
Description |
IReadOnlyCollection<pdftron.PDF.Point> |
eraserPagePoints |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
protected void ApplyEraserToAllAnnots(List<Point> eraserPagePoints)
Parameters
Type |
Name |
Description |
List<pdftron.PDF.Point> |
eraserPagePoints |
|
Check all requirements to allow the current drawing to be performed
Declaration
protected bool CanDrawingBePerformed()
Returns
Type |
Description |
System.Boolean |
|
Returns true if it is possible to redo a stroke
Declaration
public bool CanRedoStroke()
Returns
Type |
Description |
System.Boolean |
|
Returns true if it is possible to undo a stoke
Declaration
public bool CanUndoStroke()
Returns
Type |
Description |
System.Boolean |
|
Check if we can start drawing and if so set mStartDrawing to True
Declaration
protected void CheckIfShouldStartDrawing()
Saves the ink annotation to the PDF
Declaration
public void CommitAnnotation()
Redo the last undone stroke
Declaration
Declaration
protected void ReleaseEraserPointer(object sender, PointerRoutedEventArgs e)
Parameters
Type |
Name |
Description |
System.Object |
sender |
|
Windows.UI.Xaml.Input.PointerRoutedEventArgs |
e |
|
Declaration
protected void ReleaseInkPointer(object sender, PointerRoutedEventArgs e)
Parameters
Type |
Name |
Description |
System.Object |
sender |
|
Windows.UI.Xaml.Input.PointerRoutedEventArgs |
e |
|
Declaration
public void SetEraserProperties(bool eraseOnlyCurrentInk, double thickness, double opacity, Color color)
Parameters
Type |
Name |
Description |
System.Boolean |
eraseOnlyCurrentInk |
|
System.Double |
thickness |
|
System.Double |
opacity |
|
Windows.UI.Color |
color |
|
Declaration
protected void SetEraserPropertiesInternal(bool eraseOnlyCurrentInk, double thickness, double opacity, Color color)
Parameters
Type |
Name |
Description |
System.Boolean |
eraseOnlyCurrentInk |
|
System.Double |
thickness |
|
System.Double |
opacity |
|
Windows.UI.Color |
color |
|
Lets you change the brush properties while between strokes, though it will change past strokes as well.
Declaration
public void SetInkProperties(double thickness, double opacity, Color color)
Parameters
Type |
Name |
Description |
System.Double |
thickness |
|
System.Double |
opacity |
|
Windows.UI.Color |
color |
|
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Declaration
Events
Declaration
public event FreehandCreate.AllStrokesMadeInvisibleDelagate AllStrokesMadeInvisible
Event Type
This event is raised whenever the current stroke is modified
Declaration
public event FreehandCreate.CurrentStrokeModifedDelegate CurrentStrokeModifed
Event Type
This even is invoked when a path has been drawn for the ink annotation.
Note: It is not invoked after a call to RedoStroke()
Declaration
public event FreehandCreate.StrokeAddedDelegate StrokeAdded
Event Type
This even is raised whenever a whole path is no longer visible (e.g. as a result of undo)
Declaration
public event FreehandCreate.StrokeMadeInvisibleDelegate StrokeMadeInvisible
Event Type
This event is raised whenever a whole path is visible (e.g. as a result of drawing or redo)
Declaration
public event FreehandCreate.StrokeMadeVisibleDelegate StrokeMadeVisible
Event Type
This event is invoked when the Tool detects a Stylus and is not already in
Stylus mode (i.e. IsUsingSylus is false).
Declaration
public event FreehandCreate.StylusIsDetectedDelegate StylusIsDetected
Event Type
Implements
Windows.UI.Composition.IAnimationObject
Windows.UI.Composition.IVisualElement
Extension Methods