public void InitStrokeTipBuilder(StylusPointCollectionInfo stylusPointCollectionInfo) { StrokeInfo strokeInfo = stylusPointCollectionInfo.StrokeInfo; InkRenderInfo inkRenderInfo = strokeInfo.InkRenderInfo; InkStrokeTipBuilder inkStrokeTipBuilder = inkRenderInfo.InkStrokeTipBuilderBuilder.GetInkStrokeTipBuilder(); inkStrokeTipBuilder.Brush = strokeInfo.FillSolidColorBrush; inkStrokeTipBuilder.DrawingAttributes = strokeInfo.DrawingAttributes; inkRenderInfo.StrokeTipBuilder = inkStrokeTipBuilder; inkRenderInfo.ContainerVisual.Children.Add(inkRenderInfo.StrokeTipBuilder.CreateStroke()); this.RenderPackets(stylusPointCollectionInfo); }
public void RenderPackets(StylusPointCollectionInfo stylusPointCollectionInfo) { StrokeInfo strokeInfo = stylusPointCollectionInfo.StrokeInfo; InkRenderInfo inkRenderInfo = strokeInfo.InkRenderInfo; foreach (var stylusPoint in stylusPointCollectionInfo.StylusPlugInCollection) { StylusPointCollection stylusPointCollection = inkRenderInfo.StrokeTipBuilder.AddPoint(stylusPoint); if (stylusPointCollection != null) { StrokeVisual strokeVisual = new StrokeVisual(strokeInfo.FillSolidColorBrush, strokeInfo.DrawingAttributes, stylusPointCollection); inkRenderInfo.ContainerVisual.Children.Add(strokeVisual); inkRenderInfo.StrokeVisualList.AddLast(strokeVisual); strokeVisual.Redraw(); } } // inkRenderInfo.StrokeTipBuilder.Redraw(); }
public StrokeInfo(int stylusDeviceId, DrawingAttributes drawingAttributes, SolidColorBrush fillSolidColorBrush, int startTime, InkRenderInfo inkRenderInfo) { if (drawingAttributes == null) { throw new ArgumentNullException("drawingAttributes"); } if (fillSolidColorBrush == null) { throw new ArgumentNullException("fillSolidColorBrush"); } if (inkRenderInfo == null) { throw new ArgumentNullException("inkRenderInfo"); } StylusDeviceId = stylusDeviceId; DrawingAttributes = drawingAttributes; FillSolidColorBrush = fillSolidColorBrush; StartTime = startTime; this.LastTime = startTime; this.StrokeNodeIterator = new StrokeNodeIterator(drawingAttributes); InkRenderInfo = inkRenderInfo; }