alpha
This commit is contained in:
@@ -0,0 +1,135 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace InkCanvasForClass.IccInkCanvas.Settings {
|
||||
public class BoardSettings {
|
||||
public BoardSettings() {}
|
||||
|
||||
private double _NibWidth { get; set; } = 4.00;
|
||||
|
||||
/// <summary>
|
||||
/// 笔尖长度
|
||||
/// </summary>
|
||||
public double NibWidth {
|
||||
get => _NibWidth;
|
||||
set {
|
||||
if (Math.Abs(_NibWidth - value) < 0.0001) return;
|
||||
_NibWidth = value;
|
||||
NibWidthChanged?.Invoke(this,EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private double _NibHeight { get; set; } = 4.00;
|
||||
|
||||
/// <summary>
|
||||
/// 笔尖高度
|
||||
/// </summary>
|
||||
public double NibHeight {
|
||||
get => _NibWidth;
|
||||
set {
|
||||
if (Math.Abs(_NibHeight - value) < 0.0001) return;
|
||||
_NibHeight = value;
|
||||
NibHeightChanged?.Invoke(this,EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private NibType _NibType { get; set; } = NibType.Default;
|
||||
|
||||
public NibType NibType {
|
||||
get => _NibType;
|
||||
set {
|
||||
if (_NibType == value) return;
|
||||
_NibType = value;
|
||||
NibTypeChanged?.Invoke(this,EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private Color _NibColor { get; set; } = Colors.Black;
|
||||
|
||||
/// <summary>
|
||||
/// 笔尖颜色
|
||||
/// </summary>
|
||||
public Color NibColor {
|
||||
get => _NibColor;
|
||||
set {
|
||||
if (_NibColor.Equals(value)) return;
|
||||
_NibColor = value;
|
||||
NibColorChanged?.Invoke(this,EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private StrokeNibStyle _StrokeNibStyle { get; set; } = StrokeNibStyle.Beautiful;
|
||||
|
||||
/// <summary>
|
||||
/// 笔锋样式类型,默认有笔锋
|
||||
/// </summary>
|
||||
public StrokeNibStyle StrokeNibStyle {
|
||||
get => _StrokeNibStyle;
|
||||
set {
|
||||
if (_StrokeNibStyle == value) return;
|
||||
_StrokeNibStyle = value;
|
||||
StrokeNibStyleChanged?.Invoke(this,EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _IsForceIgnoreStylusPressure { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 强制忽略支持压力传感的输入设备返回的真实压力值(比如支持压感的手写笔)
|
||||
/// </summary>
|
||||
public bool IsForceIgnoreStylusPressure {
|
||||
get => _IsForceIgnoreStylusPressure;
|
||||
set {
|
||||
if (_IsForceIgnoreStylusPressure == value) return;
|
||||
_IsForceIgnoreStylusPressure = value;
|
||||
IsForceIgnoreStylusPressureChanged?.Invoke(this,EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private EraserType _EraserType { get; set; } = EraserType.Rectangle;
|
||||
|
||||
/// <summary>
|
||||
/// 指定橡皮擦的形状,支持矩形和圆形
|
||||
/// </summary>
|
||||
public EraserType EraserType {
|
||||
get => _EraserType;
|
||||
set {
|
||||
if (_EraserType == value) return;
|
||||
_EraserType = value;
|
||||
EraserTypeChanged?.Invoke(this,EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private double _EraserSize { get; set; } = 32D;
|
||||
|
||||
/// <summary>
|
||||
/// 指定橡皮擦的大小,矩形橡皮擦为宽度(高度自动确定),圆形橡皮擦为直径
|
||||
/// </summary>
|
||||
public double EraserSize {
|
||||
get => _EraserSize;
|
||||
set {
|
||||
if (_EraserSize == value) return;
|
||||
_EraserSize = value;
|
||||
EraserSizeChanged?.Invoke(this,EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region Events
|
||||
|
||||
public event EventHandler<EventArgs> NibWidthChanged;
|
||||
public event EventHandler<EventArgs> NibHeightChanged;
|
||||
public event EventHandler<EventArgs> NibColorChanged;
|
||||
public event EventHandler<EventArgs> NibTypeChanged;
|
||||
public event EventHandler<EventArgs> StrokeNibStyleChanged;
|
||||
public event EventHandler<EventArgs> IsForceIgnoreStylusPressureChanged;
|
||||
public event EventHandler<EventArgs> EraserTypeChanged;
|
||||
public event EventHandler<EventArgs> EraserSizeChanged;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace InkCanvasForClass.IccInkCanvas.Settings {
|
||||
|
||||
/// <summary>
|
||||
/// IccBoard的编辑模式
|
||||
/// </summary>
|
||||
public enum EditingMode {
|
||||
/// <summary>
|
||||
/// 仅显示墨迹,不会接收任何输入事件,没有HitTest
|
||||
/// </summary>
|
||||
None,
|
||||
/// <summary>
|
||||
/// 仅显示墨迹,不会接收任何输入事件,有HitTest
|
||||
/// </summary>
|
||||
NoneWithHitTest,
|
||||
/// <summary>
|
||||
/// 书写模式,该模式下允许临时切换到橡皮擦模式
|
||||
/// </summary>
|
||||
Writing,
|
||||
/// <summary>
|
||||
/// 墨迹擦模式
|
||||
/// </summary>
|
||||
StrokeErasing,
|
||||
/// <summary>
|
||||
/// 板擦模式
|
||||
/// </summary>
|
||||
GeometryErasing,
|
||||
/// <summary>
|
||||
/// 区域擦除模式
|
||||
/// </summary>
|
||||
AreaErasing,
|
||||
/// <summary>
|
||||
/// 墨迹选择模式
|
||||
/// </summary>
|
||||
Select,
|
||||
/// <summary>
|
||||
/// 仅显示墨迹,仅接受手势输入
|
||||
/// </summary>
|
||||
Gestures,
|
||||
/// <summary>
|
||||
/// 形状绘制模式,该模式不能被用户直接设置
|
||||
/// </summary>
|
||||
ShapeDrawing,
|
||||
/// <summary>
|
||||
/// 漫游模式
|
||||
/// </summary>
|
||||
RoamingMode
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace InkCanvasForClass.IccInkCanvas.Settings {
|
||||
public enum BoardPageAppendMode {
|
||||
/// <summary>
|
||||
/// 添加到所有页面的最后去
|
||||
/// </summary>
|
||||
AppendToListEnd,
|
||||
/// <summary>
|
||||
/// 添加为当前页面的下一页
|
||||
/// </summary>
|
||||
AppendAfterItem,
|
||||
/// <summary>
|
||||
/// 添加为当前页面的上一页
|
||||
/// </summary>
|
||||
AppendBeforeItem,
|
||||
/// <summary>
|
||||
/// 添加到所有页面的最前面去
|
||||
/// </summary>
|
||||
AppendToListStart
|
||||
}
|
||||
|
||||
public enum PageSwitchMode {
|
||||
SwitchToPreviousPage,
|
||||
SwitchToNextPage,
|
||||
}
|
||||
|
||||
public enum InputtingDeviceType {
|
||||
None,
|
||||
Mouse,
|
||||
Touch,
|
||||
Stylus
|
||||
}
|
||||
|
||||
public enum EraserType {
|
||||
Rectangle,
|
||||
Ellipse,
|
||||
}
|
||||
|
||||
internal enum CommitReason {
|
||||
/// <summary>
|
||||
/// 由用户输入
|
||||
/// </summary>
|
||||
UserInput,
|
||||
/// <summary>
|
||||
/// 由代码手动添加
|
||||
/// </summary>
|
||||
CodeInput,
|
||||
/// <summary>
|
||||
/// 形状绘制
|
||||
/// </summary>
|
||||
ShapeDrawing,
|
||||
/// <summary>
|
||||
/// 墨迹识别
|
||||
/// </summary>
|
||||
ShapeRecognition,
|
||||
/// <summary>
|
||||
/// 清空画布
|
||||
/// </summary>
|
||||
ClearingCanvas,
|
||||
/// <summary>
|
||||
/// 已过时,不再直接对Stroke进行Transform来实现Manipulation
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
Manipulation
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace InkCanvasForClass.IccInkCanvas.Settings {
|
||||
|
||||
/// <summary>
|
||||
/// 定义了笔尖类型
|
||||
/// </summary>
|
||||
public enum NibType {
|
||||
/// <summary>
|
||||
/// 默认笔
|
||||
/// </summary>
|
||||
Default,
|
||||
/// <summary>
|
||||
/// 荧光笔
|
||||
/// </summary>
|
||||
Highlighter
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 笔锋样式
|
||||
/// </summary>
|
||||
public enum StrokeNibStyle {
|
||||
/// <summary>
|
||||
/// 默认,直接根据输入设备提供的压力值正常渲染
|
||||
/// </summary>
|
||||
Default,
|
||||
/// <summary>
|
||||
/// 强制无笔锋
|
||||
/// </summary>
|
||||
Solid,
|
||||
/// <summary>
|
||||
/// 有笔锋,基于固定点集算法计算,触笔设备不套用算法
|
||||
/// </summary>
|
||||
Beautiful
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user