zertac / WPF-Whiteboard

C# WPF Canvas Whiteboard Library for .Net Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WPF-Whiteboard - Annotation (Under construction)

This repository contains wpf canvas based whiteboard - annotation project.

General capabilities

  • Draw basic and custom shapes
  • Inkcanvas drawing
  • Move, resize and delete shapes.
  • Set style before drawing or change style at run time.
  • Basic object selection and rectangular multiple object selection with mouse.
  • Get object properties (style, position, selected object count etc)
  • Custom shape - (You can override your own path data for drawing custom shapes)
  • Keyboard shortcuts for simple functions
  • Erase objects and ink strokes by stylus pen inverse

Current shapes

  • Rectangle
  • Ellipse
  • Line
  • Triangle
  • Text
  • Ink Canvas
  • Arrow
  • Custom Shape

Installation

Download repository and add to your solution. Add reference as project reference to your own project and start to use XDrawer.

Using

Initialize XDrawer

Drawer.Initialize({Your own canvas});

User your first brush

 Drawer.DrawTool = Tool.Rectangle;

Change default brush style

 var style = new DrawerStyle();
 style.Border = new SolidColorBrush(Colors.Black);
 style.Background = new SolidColorBrush(Colors.Red);
 style.Opacity = 1;
 style.BorderSize = 3;
 
 StyleHelper.CurrentStyle = style;

Get selected object 'return as FrameworkElement

var element = Drawer.GetSeletectedObject();

Get selected shape 'return as XShape

var shape = Drawer.GetSelectedShape();

Get created shape count

var count = Drawer.GetShapeCount();

Cancel drawing

Drawer.CancelDrawing();

Delete selected shape

Selector.DeleteSelected();

Delete specific shape

var element = Drawer.GetSelectedObject();
Selector.DeleteObject(element);

About

C# WPF Canvas Whiteboard Library for .Net Framework


Languages

Language:C# 100.0%