CCT.NUI.Samples.ImageManipulation.ImageOperations.ZoomArea C# (CSharp) Метод

ZoomArea() публичный статический Метод

public static ZoomArea ( Point startDragLocation, Point endDragLocation, Size originalSize, Size targetSize, Size border ) : Rectangle
startDragLocation Point
endDragLocation Point
originalSize System.Drawing.Size
targetSize System.Drawing.Size
border System.Drawing.Size
Результат System.Drawing.Rectangle
        public static Rectangle ZoomArea(Point startDragLocation, Point endDragLocation, Size originalSize, Size targetSize, Size border)
        {
            var screenArea = GetRectangle(startDragLocation, endDragLocation);
            screenArea.X -= border.Width;
            screenArea.Y -= border.Height;

            var factor = 1m / ProportionalScaleRatio(originalSize.Width, originalSize.Height, targetSize.Width, targetSize.Height);

            if (screenArea.Width > 0 && screenArea.Height > 0)
            {
                return Multiply(screenArea, factor);
            }
            return Rectangle.Empty;
        }