Let's say I have loaded a raster with a world file.
What is the right way to zoom the Map control so that the raster image just fills the Control's viewable area? (for example upon loading the raster or upon resizing the control)
Keep in mind that there is going to be some right/left or top/bottom margin if the width/height ratio of the bounding box of the image layer is not exactely the same as the width/height ratio of map. This is normal.
I think we need to pay attention to following things to make the raster image just fill the control: 1) Setting correct ZoomLevelSnappingMode. The default ZoomLevelSnappingMode is SnapingMode which indicates the zoom level will be adjusted to the preset 20 zoomlevels. So try to set the None snapping mode. 2) Setting the correct with / height ratio for the MapControl, ideally it should be exactly the same ratio with the width and height of the raster file. 3) Setting the correct extent for the Map Control. Just set the raster image extent to the map control.
Any more questions or concerns please do not hesitate to let me know.