示例#1
0
        public static double PixelsToDocument(double resolution, int value)
        {
            if (LeadDoubleTools.IsZero(resolution))
            {
                resolution = 96.0;
            }

            return(value * UnitsPerInch / resolution);
        }
示例#2
0
        public static int DocumentToPixels(double resolution, double value)
        {
            if (LeadDoubleTools.IsZero(resolution))
            {
                resolution = 96.0;
            }

            return((int)((value / UnitsPerInch) * resolution + 0.5));
        }