TransformPoint() публичный Метод

public TransformPoint ( double &x, double &y ) : void
x double
y double
Результат void
Пример #1
0
 public void DeviceToUser(ref double x, ref double y)
 {
     Cairo.Matrix inv = (Cairo.Matrix) this.transformMatrix.Clone();
     Cairo.Status cs  = inv.Invert();
     if (cs == Cairo.Status.Success)
     {
         inv.TransformPoint(ref x, ref y);
     }
     else
     {
         throw new Exception("Unable to transform device coordinates to user coordinates because the matrix was uninvertible (" + cs.ToString() + ").");
     }
 }
Пример #2
0
        public static List<List<IntPoint>> Transform(List<List<IntPoint>> selection, Matrix transform)
        {
            List<List<IntPoint>> newPolygons = new List<List<IntPoint>> ();

            foreach (List<IntPoint> ipL in selection) {
                List<IntPoint> newPolygon = new List<IntPoint> ();

                foreach (IntPoint ip in ipL) {
                    double x = ip.X;
                    double y = ip.Y;
                    transform.TransformPoint (ref x, ref y);
                    newPolygon.Add (new IntPoint ((long)x, (long)y));
                }

                newPolygons.Add (newPolygon);
            }

            return newPolygons;
        }