PdfSharp.Drawing.XGraphics.CreateMeasureContext C# (CSharp) Method

CreateMeasureContext() public static method

Creates the measure context. This is a graphics context created only for querying measures of text. Drawing on a measure context has no effect.
public static CreateMeasureContext ( PdfSharp.Drawing.XSize size, XGraphicsUnit pageUnit, XPageDirection pageDirection ) : XGraphics
size PdfSharp.Drawing.XSize
pageUnit XGraphicsUnit
pageDirection XPageDirection
return XGraphics
    public static XGraphics CreateMeasureContext(XSize size, XGraphicsUnit pageUnit, XPageDirection pageDirection)
    {
      XGraphics gfx = null;
#if GDI
      gfx = new XGraphics(Graphics.FromImage(new Bitmap(100, 100)), size, pageUnit, pageDirection);
#endif
#if WPF && !SILVERLIGHT
      gfx = new XGraphics((System.Windows.Media.DrawingContext)null, size, pageUnit, pageDirection);
#endif
#if SILVERLIGHT
      gfx = new XGraphics(new Canvas(), size, pageUnit, pageDirection);
#endif
      return gfx;
    }