Esempio n. 1
0
 public Point ConvertToUnity(Point p)
 {
     return(new Point()
     {
         X = Unit == UnitType.Cm ? DipHelper.DipToCm(p.X) : DipHelper.DipToInch(p.X),
         Y = Unit == UnitType.Cm ? DipHelper.DipToCm(p.Y) : DipHelper.DipToInch(p.Y),
     });
 }
Esempio n. 2
0
        protected FormattedText GetFormatedText(double realX, double realStep)
        {
            string szFormat = "F";

            int nSigni = GetFirstSignificantPos(realStep);

            string szSig = nSigni.ToString();

            szFormat += szSig;

            FormattedText ft = new FormattedText(
                realX.ToString(szFormat, CultureInfo.CurrentCulture),
                CultureInfo.CurrentCulture,
                FlowDirection.LeftToRight,
                new Typeface("Arial"),
                DipHelper.PtToDip(6),
                Brushes.DimGray);

            ft.SetFontWeight(FontWeights.Regular);
            ft.TextAlignment = TextAlignment.Center;

            return(ft);
        }
Esempio n. 3
0
 public double ConvertToUnity(double p)
 {
     return(Unit == UnitType.Cm ? DipHelper.DipToCm(p) : DipHelper.DipToInch(p));
 }