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), }); }
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); }
public double ConvertToUnity(double p) { return(Unit == UnitType.Cm ? DipHelper.DipToCm(p) : DipHelper.DipToInch(p)); }