日期:2014-05-20 浏览次数:21480 次
class DialogLabel : FrameworkElement
{
VisualCollection childs;
DrawingVisual dv = new DrawingVisual();
Brush bl = new SolidColorBrush(Color.FromArgb(0xff, 0x00, 0xff, 0x00));
Pen p = new Pen(new SolidColorBrush(Color.FromArgb(0xff, 0x00, 0xff, 0x00)), 1);
public DialogLabel()
{
bl.Opacity = 0.5;
p.Brush.Opacity = 0.5;
p.Freeze();
childs = new VisualCollection(this);
using (DrawingContext dc = dv.RenderOpen())
{
List<PathFigure> points = new List<PathFigure>();
PathFigure pf = new PathFigure();
pf.StartPoint = new Point(0, 20);
pf.Segments.Add(new ArcSegment(new Point(20,0),new Size(20,20),90,false,SweepDirection.Clockwise,true));
pf.Segments.Add(new LineSegment(new Point(80, 0), true));
pf.Segments.Add(new ArcSegment(new Point(100, 20), new Size(20, 20), 90, false, SweepDirection.Clockwise, true));
pf.Segments.Add(new LineSegment(new Point(100, 60), true));
pf.Segments.Add(new ArcSegment(new Point(80, 80), new Size(20, 20), 90, false, SweepDirection.Clockwise, true));
pf.Segments.Add(new LineSegment(new Point(48, 80), true));
pf.Segments.Add(new LineSegment(new Point(40, 100), true));
pf.Segments.Add(new LineSegment(new Point(32, 80), true));
pf.Segments.Add(new LineSegment(new Point(20, 80), true));
pf.Segments.Add(new ArcSegment(new Point(0, 60), new Size(20, 20), 90, false, SweepDirection.Clockwise, true));