MapSuiteGisEditor/WpfDesktopExtension/Shares/MapEngine.cs
// This function takes a height and width in screen coordinates, then
// looks at the current extent and returns an adjusted world rectangle
// so that the ratio to height and width in screen and world coordinates match.
/// <summary>
/// This method returns an adjusted extent based on the ratio of the screen width and
/// height.
/// </summary>
/// <returns>
/// This method returns an adjusted extent based on the ratio of the screen width and
/// height.
/// </returns>
/// <remarks>
/// This function is used because the extent to draw must be the rame ratio as the screen
/// width and height. If they are not, then the image drawn will be stretched or compressed.
/// We always adjust the extent upwards to ensure that no matter how we adjust it,
/// the original extent will fit within the new extent. This ensures that everything
/// you wanted to see in the first extent is visible and maybe a bit more.
/// </remarks>
/// <param name="screenWidth">This parameter is the width of the screen.</param>
/// <param name="screenHeight">This parameter is the height of the screen.</param>
This method returns an adjusted extent based on the ratio of the screen width and
height.
This method returns an adjusted extent based on the ratio of the screen width and height .
public RectangleShape GetDrawingExtent(float screenWidth, float screenHeight)
        {
            ValidatorHelper.CheckInputValueIsLargerThan(screenWidth, "screenWidth", 0, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckInputValueIsLargerThan(screenHeight, "screenHeight", 0, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckExtentIsValid(currentExtent, "currentExtent");
            return GetDrawingExtent(currentExtent, screenWidth, screenHeight);
        }
public RectangleShape GetDrawingExtent ( float screenWidth , float screenHeight ) { ValidatorHelper . CheckInputValueIsLargerThan ( screenWidth , " " , 0 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckInputValueIsLargerThan ( screenHeight , " " , 0 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckExtentIsValid ( currentExtent , " " ) ; return GetDrawingExtent ( currentExtent , screenWidth , screenHeight ) ; }
This method returns an adjusted extent based on the ratio of the screen width and
height.
This method returns an adjusted extent based on the ratio of the screen width and height .
This method returns an adjusted extent based on the ratio of the screen width and
height.
This method returns an adjusted extent based on the ratio of the screen width and height .
screenWidth
float
This parameter is the width of the screen.
This parameter is the width of the screen .
screenHeight
float
This parameter is the height of the screen.
This parameter is the height of the screen .
remarks
This function is used because the extent to draw must be the rame ratio as the screen
width and height. If they are not, then the image drawn will be stretched or compressed.
We always adjust the extent upwards to ensure that no matter how we adjust it,
the original extent will fit within the new extent. This ensures that everything
you wanted to see in the first extent is visible and maybe a bit more.
This function is used because the extent to draw must be the rame ratio as the screen width and height . If they are not then the image drawn will be stretched or compressed . We always adjust the extent upwards to ensure that no matter how we adjust it the original extent will fit within the new extent . This ensures that everything you wanted to see in the first extent is visible and maybe a bit more .