コード例 #1
0
ファイル: MouseRender.cs プロジェクト: zhangopeng/WpfPaint
            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);
            }
コード例 #2
0
ファイル: MouseRender.cs プロジェクト: zhangopeng/WpfPaint
            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();
            }
コード例 #3
0
ファイル: MouseRender.cs プロジェクト: zhangopeng/WpfPaint
 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;
 }