Subtract() public static method

Translates a by the negative of a given .

public static Subtract ( Point pt, Size sz ) : Point
pt Point
sz Size
return Point
コード例 #1
0
        /// <summary>
        /// Update our coordinates to reflect a new top-left pixel
        /// </summary>
        /// <param name="topLeftXY">The top-left pixel</param>
        public void UpdateFromXY(Point topLeftXY)
        {
            var max = Point.Subtract(LngLatToXY(new PointF(180, -75), ZoomLevel), DisplayRectangle.Size);
            var min = LngLatToXY(new PointF(-180, 82), ZoomLevel);

            topLeftXY.X = Math.Max(Math.Min(max.X, topLeftXY.X), min.X);
            topLeftXY.Y = Math.Max(Math.Min(max.Y, topLeftXY.Y), min.Y);

            //Point.Subtract(TopLeftXY, DisplayRectangle.Size)

            PointF oldCenter = Center;

            //Update our top-left coordinates
            this.TopLeftXY = topLeftXY;
            this.TopLeft   = XYToLngLat(topLeftXY, ZoomLevel);

            //Determine our bottom-right pixel
            this.BottomRightXY = Point.Add(topLeftXY, DisplayRectangle.Size);
            this.BottomRight   = XYToLngLat(this.BottomRightXY, ZoomLevel);

            if (this.Panned != null)
            {
                this.Panned(oldCenter, Center);
            }
        }
コード例 #2
0
ファイル: PlayerObject.cs プロジェクト: nerestaren/mir2
 public override bool MouseOver(Point p)
 {
     return MapControl.MapLocation == CurrentLocation || BodyLibrary != null && BodyLibrary.VisiblePixel(DrawFrame + ArmourOffSet, p.Subtract(FinalDrawLocation), false);
 }
コード例 #3
0
ファイル: MirImageControl.cs プロジェクト: Pete107/Mir2
 public override bool IsMouseOver(Point p)
 {
     return base.IsMouseOver(p) && (!_pixelDetect || Library.VisiblePixel(Index, p.Subtract(DisplayLocation),true) || Moving);
 }
コード例 #4
0
ファイル: Point.cs プロジェクト: shekky/Shaman.System.Drawing
 /// <summary>Translates a <see cref="T:System.Drawing.Point" /> by the negative of a given <see cref="T:System.Drawing.Size" />.</summary>
 /// <returns>A <see cref="T:System.Drawing.Point" /> structure that is translated by the negative of a given <see cref="T:System.Drawing.Size" /> structure.</returns>
 /// <param name="pt">The <see cref="T:System.Drawing.Point" /> to translate. </param>
 /// <param name="sz">A <see cref="T:System.Drawing.Size" /> that specifies the pair of numbers to subtract from the coordinates of <paramref name="pt" />. </param>
 /// <filterpriority>3</filterpriority>
 public static Point operator -(Point pt, Size sz)
 {
     return(Point.Subtract(pt, sz));
 }
コード例 #5
0
ファイル: PanTool.cs プロジェクト: pyro-dragon/AwesomeCanvas
 public void Move(Point pPoint)
 {
     Point panDelta = pPoint.Subtract(m_panPosition);
     m_window.SetPanPosition(m_window.GetPanPosition().Add(panDelta));
 }