public override void SetupStrokeTool(Windows.Devices.Input.PointerDevice device) { PathPointLayout layout = mActiveTool.GetLayout(device.PointerDeviceType); Calculator calculator = mActiveTool.GetCalculator(device.PointerDeviceType); RasterInkBuilder.UpdatePipeline(layout, calculator, mActiveTool.ParticleSpacing); }
public RasterInkStroke(RasterInkBuilder inkBuilder, PointerDeviceType pointerDeviceType, List <float> points, uint seed, RasterBrush rasterBrush, ParticleBrush particleBrush, StrokeConstants StrokeParams, Identifier sensorDataId) { Id = Identifier.FromNewGuid(); PointerDeviceType = pointerDeviceType; uint channelMask = (uint)inkBuilder.SplineInterpolator.InterpolatedSplineLayout.ChannelMask; Path = new ParticleList(); Path.Assign(points, channelMask); RandomSeed = seed; StrokeConstants = StrokeParams; SensorDataId = sensorDataId; RasterBrush = rasterBrush; ParticleBrush = particleBrush; // Cloning is needed, otherwise the spatial data is corrupted Spline = inkBuilder.SplineProducer.AllData.Clone(); Layout = inkBuilder.Layout; }
public void EncodeCurrentStroke(string pointerDeviceType, RasterInkBuilder inkBuilder, StrokeConstants strokeConstants, uint startRandomSeed) { var rasterBrush = inkBuilder.CreateSerializationBrush("will://examples/brushes/" + Guid.NewGuid().ToString()); var style = new Wacom.Ink.Serialization.Model.Style(rasterBrush.Name); style.PathPointProperties.Red = strokeConstants.Color.R / 255.0f; style.PathPointProperties.Green = strokeConstants.Color.G / 255.0f; style.PathPointProperties.Blue = strokeConstants.Color.B / 255.0f; style.PathPointProperties.Alpha = strokeConstants.Color.A / 255.0f; AddRasterBrushToInkDoc(pointerDeviceType, rasterBrush, style, strokeConstants, startRandomSeed); EncodeCurrentStrokeCommon(pointerDeviceType, inkBuilder, style); }
public RasterInkControl(RasterBrushStyle brushStyle, MediaColor color, InkModel inkDocument = null) { InitializeComponent(); mInkBuilder = new RasterInkBuilder(); mInkBuilder.LayoutUpdated += InkBuilder_LayoutUpdated; BrushColor = color; mBrushStyle = brushStyle; mInkDocument = inkDocument; StartProcessingInput(); }