Esri / Esri/arcobjects-sdk-community-samples
How to zoom to raster resolution?
- Dominant language
- C#
- Stars
- 122
- Forks
- 190
- PR merge metrics
- No merged PRs in 30d
Description
I use this code,but it's not perfect solution
```
pActiveView.Extent = (pRasterLayer as IGeoDataset).Extent;
IntPtr pHandle = new IntPtr(pActiveView.ScreenDisplay.hWnd);
AxMapControl axMapControl1 = Form.FromHandle(pHandle) as AxMapControl;
int controlWidth = axMapControl1.Width;
double controlW = Convert.ToDouble(controlWidth);
IMap pMap = pActiveView.FocusMap;
pMap.MapScale = (controlW / pRasterLayer.ColumnCount * pMap.MapScale);
MessageBox.Show(pMap.MapScale.ToString());
pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
```
ArcGIS 10.6.1+C#
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.