LongoMatch.Drawing.TestCanvas.Scale C# (CSharp) Method

Scale() private method

private Scale ( ) : void
return void
        void Scale()
        {
            double scaleX, scaleY;
            Point translation;

            /* Scale the canvas to fit in the widget kepping DAR */
            Image.ScaleFactor (CANVAS_WIDTH, CANVAS_HEIGHT, (int)widget.Width, (int)widget.Height,
                ScaleMode.AspectFit, out scaleX, out scaleY, out translation);
            ClipRegion = new Area (new Point (translation.X, translation.Y),
                CANVAS_WIDTH * scaleX, CANVAS_HEIGHT * scaleY);
            ScaleX = scaleX;
            ScaleY = scaleY;
            Translation = translation;
        }