MapSuiteGisEditor/WpfDesktopExtension/Shares/MapEngine.cs
/// <summary>This method returns an extent 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 world point.
/// </overloads>
/// <returns>This method returns an extent that is centered and zoomed in.</returns>
/// <remarks>
/// The resulting rectangle will already 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="centerFeature">This parameter is the world point you want the extent to be centered on.</param>
/// <param name="screenWidth">This parameter is the width in screen coordinates.</param>
/// <param name="screenHeight">This parameter is the height in screen coordinates.</param>
This method returns an extent that is centered and zoomed in.
This method returns an extent that is centered and zoomed in .
public void ZoomIntoCenter(int percentage, Feature centerFeature, float screenWidth, float screenHeight)
        {
            ValidatorHelper.CheckInputValueIsInRange(percentage, "percentage", 0, RangeCheckingInclusion.ExcludeValue, 100, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckInputValueIsLargerThan(screenWidth, "screenWidth", 0, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckInputValueIsLargerThan(screenHeight, "screenHeight", 0, RangeCheckingInclusion.ExcludeValue);
            ValidatorHelper.CheckExtentIsValid(currentExtent, "currentExtent");
            currentExtent = ZoomIntoCenter(currentExtent, percentage, centerFeature, screenWidth, screenHeight);
        }
public void ZoomIntoCenter ( int percentage , Feature centerFeature , float screenWidth , float screenHeight ) { ValidatorHelper . CheckInputValueIsInRange ( percentage , " " , 0 , RangeCheckingInclusion . ExcludeValue , 100 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckInputValueIsLargerThan ( screenWidth , " " , 0 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckInputValueIsLargerThan ( screenHeight , " " , 0 , RangeCheckingInclusion . ExcludeValue ) ; ValidatorHelper . CheckExtentIsValid ( currentExtent , " " ) ; currentExtent = ZoomIntoCenter ( currentExtent , percentage , centerFeature , screenWidth , screenHeight ) ; }
This method returns an extent that is centered and zoomed in.
This method returns an extent that is centered and zoomed in .
This method returns an extent that is centered and zoomed in.
This method returns an extent that is centered and zoomed in .
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 .
centerFeature
Feature
This parameter is the world point you want the extent to be centered on.
This parameter is the world point you want the extent to be centered on .
screenWidth
float
This parameter is the width in screen coordinates.
This parameter is the width in screen coordinates .
screenHeight
float
This parameter is the height in screen coordinates.
This parameter is the height in screen coordinates .
overloads
This overload allows you to pass in the height and width in screen coordinates,
as well as a world point.
This overload allows you to pass in the height and width in screen coordinates as well as a world point .
remarks
The resulting rectangle will already be adjusted for the ratio of the screen. You
do not need to call GetDrawingExtent afterwards.
The resulting rectangle will already be adjusted for the ratio of the screen . You do not need to call GetDrawingExtent afterwards .