Click here to Skip to main content
12,444,287 members (51,471 online)
Rate this:
Please Sign up or sign in to vote.
See more: WPF
I am facing problem to draw a calligraphy geometryin WPF, using DrawingContext.DrawGeometry(null,Mypen, pathGeometry);Even I am assigning ScaleTransform to brush of Pen. but that is not working,If you have any solution please reply soon......

public override void Draw(DrawingContext drawingContext)
            if (drawingContext == null)
                throw new ArgumentNullException("drawingContext");
            Color oColor = Color.FromArgb((byte)(Opecity * 2.55), ObjectColor.R, ObjectColor.G, ObjectColor.B);
            Pen Mypen = new Pen(new SolidColorBrush(oColor), ActualLineWidth);
            Mypen.StartLineCap = PenLineCap.Round;
            Mypen.EndLineCap = PenLineCap.Round;
           drawingContext.PushTransform(new ScaleTransform(1, 5,this.Rectangle.Left+this.Rectangle.Width/2,this.Rectangle.Top+this.Rectangle.Height/2));
           drawingContext.PushTransform(new RotateTransform(30));
           pathGeometry=GetPathGeometryFromPoints(); //private method in same class 

           drawingContext.DrawGeometry(null, Mypen, pathGeometry);
Posted 18-Sep-12 2:40am
Updated 18-Sep-12 3:17am
Wes Aday104.2K
Wes Aday 18-Sep-12 9:19am
What exactly does "that is not working" mean? Does it not draw? Does your drawing routine never get called? The code is called but your car exploded?
deepak2121 25-Sep-12 1:47am
The above code is working fine for draw a geometry. but my requirement is how to draw a calligraphy geometry in wpf

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 25 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100