Ejemplo n.º 1
0
        public Size ViewToDevice(SizeF szView)
        {
            float f1 = 1.0F;
            float f2 = 1.0F;
            float f3 = 1.0F;
            float f4 = 1.0F;

            if (mModel != null)
            {
                if (mModel.MeasurementUnits != GraphicsUnit.Pixel)
                {
                    f1 = Measurements.UnitsPerInch(mModel.MeasurementUnits);
                    f3 = dpiX / f1;
                    f4 = dpiX / f1;
                }
                f2 = mModel.MeasurementScale;
            }
            int i = (int)(szView.Width * f2 * f3);
            int j = (int)(szView.Height * f2 * f4);

            return(new Size(i, j));
        }
Ejemplo n.º 2
0
        public Point ViewToDevice(PointF ptView)
        {
            float f1 = 1.0F;
            float f2 = 1.0F;
            float f3 = 1.0F;
            float f4 = 1.0F;

            if (mModel != null)
            {
                if (mModel.MeasurementUnits != GraphicsUnit.Pixel)
                {
                    f1 = Measurements.UnitsPerInch(mModel.MeasurementUnits);
                    f3 = dpiX / f1;
                    f4 = dpiX / f1;
                }
                f2 = mModel.MeasurementScale;
            }
            int i = (int)Math.Round((double)(ptView.X * f2 * f3));
            int j = (int)Math.Round((double)(ptView.Y * f2 * f4));

            return(new Point(i, j));
        }
Ejemplo n.º 3
0
        public SizeF DeviceToView(Size szDevice)
        {
            float f3 = 1.0F;
            float f4 = 1.0F;
            float f5 = 1.0F;
            float f6 = 1.0F;

            if (mModel != null)
            {
                if (mModel.MeasurementUnits != GraphicsUnit.Pixel)
                {
                    f3 = Measurements.UnitsPerInch(mModel.MeasurementUnits);
                    f5 = dpiX / f3;
                    f6 = dpiY / f3;
                }
                f4 = mModel.MeasurementScale;
            }
            float f1 = (float)szDevice.Width / (f4 * f5);
            float f2 = (float)szDevice.Height / (f4 * f6);

            return(new SizeF(f1, f2));
        }
Ejemplo n.º 4
0
        public PointF DeviceToView(Point ptDevice)
        {
            float f3 = 1.0F;
            float f4 = 1.0F;
            float f5 = 1.0F;
            float f6 = 1.0F;

            if (mModel != null)
            {
                if (mModel.MeasurementUnits != GraphicsUnit.Pixel)
                {
                    f3 = Measurements.UnitsPerInch(mModel.MeasurementUnits);
                    f5 = dpiX / f3;
                    f6 = dpiY / f3;
                }
                f4 = mModel.MeasurementScale;
            }
            float f1 = (float)ptDevice.X / (f4 * f5);
            float f2 = (float)ptDevice.Y / (f4 * f6);

            return(new PointF(f1, f2));
        }
Ejemplo n.º 5
0
        public SizeF ViewToDeviceF(SizeF szView)
        {
            float f3 = 1.0F;
            float f4 = 1.0F;
            float f5 = 1.0F;
            float f6 = 1.0F;

            if (mModel != null)
            {
                if (mModel.MeasurementUnits != GraphicsUnit.Pixel)
                {
                    f3 = Measurements.UnitsPerInch(mModel.MeasurementUnits);
                    f5 = dpiX / f3;
                    f6 = dpiX / f3;
                }
                f4 = mModel.MeasurementScale;
            }
            float f1 = szView.Width * f4 * f5;
            float f2 = szView.Height * f4 * f6;

            return(new SizeF(f1, f2));
        }
Ejemplo n.º 6
0
        public PointF ViewToDeviceF(PointF ptView)
        {
            float f3 = 1.0F;
            float f4 = 1.0F;
            float f5 = 1.0F;
            float f6 = 1.0F;

            if (mModel != null)
            {
                if (mModel.MeasurementUnits != GraphicsUnit.Pixel)
                {
                    f3 = Measurements.UnitsPerInch(mModel.MeasurementUnits);
                    f5 = dpiX / f3;
                    f6 = dpiX / f3;
                }
                f4 = mModel.MeasurementScale;
            }
            float f1 = ptView.X * f4 * f5;
            float f2 = ptView.Y * f4 * f6;

            return(new PointF(f1, f2));
        }