Hello,
I use below code to let user to zoom in:
private
void
ZoomInCommandExecute()
{
var printerOverlay = (PrinterInteractiveOverlay) MapControl.InteractiveOverlays[Printpreviewoverlay];
var mapPrinterLayer = ((MapPrinterLayer) (printerOverlay.PrinterLayers[Maplayer]));
var zoomLevelSet =
new
ZoomLevelSet();
double
currentScale = ExtentHelper.GetScale(worldExtent: mapPrinterLayer.MapExtent, screenWidth: (
float
) mapPrinterLayer.GetBoundingBox().Width, worldExtentUnit: mapPrinterLayer.MapUnit);
double
newScale =
ZoomLevelSet.GetLowerZoomLevelScale(currentScale: currentScale, zoomLevelSet: zoomLevelSet);
mapPrinterLayer.MapExtent = ExtentHelper.ZoomToScale(targetScale: newScale, worldExtent: mapPrinterLayer.MapExtent, worldExtentUnit: mapPrinterLayer.MapUnit, screenWidth: (
float
) mapPrinterLayer.GetBoundingBox().Width, screenHeight: (
float
) mapPrinterLayer.GetBoundingBox().Height);
MapControl.Refresh();
}
This code has been used in printing sample, my scenario is printing also.
When trying to fit a map into the page perfectly, the zoom in/out options steps in/out too much.
How do I reduce the zoom step?
Thank you,
Sean