예제 #1
0
        public static Int32Rect proporziona(Int32Rect a, Int32Size b, Int32Size c)
        {
            Int32Rect ris = new Int32Rect();

            ris.X      = ((a.X * c.Width) / b.Width);
            ris.Y      = ((a.Y * c.Height) / b.Height);
            ris.Width  = ((a.Width * c.Width) / b.Width);
            ris.Height = ((a.Height * c.Height) / b.Height);
            return(ris);
        }
예제 #2
0
 //
 // Summary:
 //     Determines whether the specified rectangle is equal to this rectangle.
 //
 // Parameters:
 //   o:
 //     The object to compare to the current rectangle.
 //
 // Returns:
 //     true if o is an System.Windows.Int32Rect and the same System.Windows.Int32Rect.X,
 //     System.Windows.Int32Rect.Y, System.Windows.Int32Rect.Width, and System.Windows.Int32Rect.Height
 //     as this rectangle; otherwise, false.
 public override bool Equals(object o)
 {
     if (o != null && o is Int32Size)
     {
         return(Int32Size.Equals(this, (Int32Size)o));
     }
     else
     {
         return(false);
     }
 }
예제 #3
0
 //
 // Summary:
 //     Determines whether the specified rectangles are equal.
 //
 // Parameters:
 //   int32Rect1:
 //     The first rectangle to compare.
 //
 //   int32Rect2:
 //     The second rectangle to compare.
 //
 // Returns:
 //     true if int32Rect1 and int32Rect2 have the same System.Windows.Int32Rect.X,
 //     System.Windows.Int32Rect.Y, System.Windows.Int32Rect.Width, and System.Windows.Int32Rect.Height;
 //     otherwise, false.
 public static bool Equals(Int32Size s1, Int32Size s2)
 {
     if (s1.Width != s2.Width)
     {
         return(false);
     }
     if (s1.Height != s2.Height)
     {
         return(false);
     }
     return(true);
 }
예제 #4
0
 //
 // Summary:
 //     Compares two rectangles for exact equality.
 //
 // Parameters:
 //   int32Rect1:
 //     The first rectangle to compare.
 //
 //   int32Rect2:
 //     The second rectangle to compare.
 //
 // Returns:
 //     true if int32Rect1 and int32Rect2 have the same
 //     , System.Windows.Int32Rect.Width, and System.Windows.Int32Rect.Height;
 //     otherwise, false.
 public static bool operator ==(Int32Size s1, Int32Size s2)
 {
     return(Int32Size.Equals(s1, s2));
 }
예제 #5
0
 // Summary:
 //     Determines whether the specified area is equal to this area.
 //
 // Parameters:
 //   value:
 //     The area to compare to the current area.
 //
 // Returns:
 //     true if both rectangles have the same System.Windows.Int32Rect.X, System.Windows.Int32Rect.Y,
 //     System.Windows.Int32Rect.Width, and System.Windows.Int32Rect.Height as this
 //     rectangle; otherwise, false.
 public bool Equals(Int32Size value)
 {
     return(Int32Size.Equals(this, value));
 }