WPF 绘制矩形

来源:转载

            TouchPoint touchPoint = e.GetTouchPoint(mywin);

            p2 = touchPoint.Position;
            RectangleGeometry rec = new RectangleGeometry();
            rec.Rect = new Rect(p1, p2);

            Path path = new Path();
            path.Fill = Brushes.LemonChiffon;
            path.Stroke = Brushes.Black;
            path.StrokeThickness = 1;
            path.Data = rec;
            canvas1.Children.Add(path);

本文来自asp89007342的博客,原文地址:http://blog.csdn.net/asp89007342/archive/2011/06/18/6553624.aspx


分享给朋友:
您可能感兴趣的文章:
随机阅读: