MapSuiteGisEditor/WpfDesktopExtension/Shares/MapEngine.cs
/// <summary>This method updates the CurrentExtent based on a calculated rectangle that is centered and zoomed in.</summary>
/// <overloads>
/// This overload allows you to pass in the height and width in screen coordinates,
/// as well as a screen X &amp; Y.
/// </overloads>
/// <returns>None.</returns>
/// <remarks>
/// The CurrentExtent will be adjusted for the ratio of the screen. You
/// do not need to call GetDrawingExtent afterwards.
/// </remarks>
/// <param name="percentage">This parameter is the percentage by which you want to zoom in.</param>
/// <param name="screenX">This parameter is the screen X you want to center on.</param>
/// <param name="screenY">This parameter is the screen Y you want to center on.</param>
/// <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 updates the CurrentExtent based on a calculated rectangle that is centered and zoomed in.
This method updates the CurrentExtent based on a calculated rectangle that is centered and zoomed in .
public void ZoomIntoCenter(int percentage, float screenX, float screenY, float screenWidth, float screenHeight)
        {
            ValidatorHelper.CheckInputValueIsInRange(percentage, "percentage", 0, RangeCheckingInclusion.ExcludeValue, 100, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckInputValueIsLargerThan(screenX, "screenX", 0, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckInputValueIsLargerThan(screenY, "screenY", 0, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckInputValueIsLargerThan(screenWidth, "screenWidth", 0, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckInputValueIsLargerThan(screenHeight, "screenHeight", 0, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckExtentIsValid(currentExtent, "currentExtent");
            currentExtent = ZoomIntoCenter(currentExtent, percentage, screenX, screenY, screenWidth, screenHeight);
        }
public void ZoomIntoCenter ( int percentage , float screenX , float screenY , float screenWidth , float screenHeight ) { ValidatorHelper . CheckInputValueIsInRange ( percentage , " " , 0 , RangeCheckingInclusion . ExcludeValue , 100 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckInputValueIsLargerThan ( screenX , " " , 0 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckInputValueIsLargerThan ( screenY , " " , 0 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckInputValueIsLargerThan ( screenWidth , " " , 0 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckInputValueIsLargerThan ( screenHeight , " " , 0 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckExtentIsValid ( currentExtent , " " ) ; currentExtent = ZoomIntoCenter ( currentExtent , percentage , screenX , screenY , screenWidth , screenHeight ) ; }
This method updates the CurrentExtent based on a calculated rectangle that is centered and zoomed in.
This method updates the CurrentExtent based on a calculated rectangle that is centered and zoomed in .
None
percentage
int
This parameter is the percentage by which you want to zoom in.
This parameter is the percentage by which you want to zoom in .
screenX
float
This parameter is the screen X you want to center on.
This parameter is the screen X you want to center on .
screenY
float
This parameter is the screen Y you want to center on.
This parameter is the screen Y you want to center on .
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 .
overloads
This overload allows you to pass in the height and width in screen coordinates,
as well as a screen X & Y.
This overload allows you to pass in the height and width in screen coordinates as well as a screen X & Y .
remarks
The CurrentExtent will be adjusted for the ratio of the screen. You
do not need to call GetDrawingExtent afterwards.
The CurrentExtent will be adjusted for the ratio of the screen . You do not need to call GetDrawingExtent afterwards .