Solved! Go to Solution.
how do you figure the screen resolution?
private static IDisplay myDisplay; private static Image myMapImage; Graphics g = Graphics.FromImage(myMapImage); g.Clear(Color.Transparent); myDisplay.StartDrawing(g.GetHdc().ToInt32(), 0); for (int i = Map.LayerCount - 1; i >= 0; i--) { ILayer layer = MapControl.get_Layer(i); layer.Draw(esriDrawPhase.esriDPGeography, myDisplay, null); } myDisplay.FinishDrawing(); g.ReleaseHdc();
Hi, basically one way is to draw layer by layer in an image object, then export itprivate static IDisplay myDisplay; private static Image myMapImage; Graphics g = Graphics.FromImage(myMapImage); g.Clear(Color.Transparent); myDisplay.StartDrawing(g.GetHdc().ToInt32(), 0); for (int i = Map.LayerCount - 1; i >= 0; i--) { ILayer layer = MapControl.get_Layer(i); layer.Draw(esriDrawPhase.esriDPGeography, myDisplay, null); } myDisplay.FinishDrawing(); g.ReleaseHdc();
I hope this is helpful for you
Thank you. But there is an error: Use of unassigned local variable 'myMapImage'
Kind regards,
Tai
you are rigth, that's my mistake, you have to initialize the variable....
System.Int32 screenResolution = 30;
System.Int32 outputResolution = 200;
pExport.Resolution = outputResolution;
ESRI.ArcGIS.Display.tagRECT exportRECT;
exportRECT.left = 0;
exportRECT.top = 0;
exportRECT.right = activeView.ExportFrame.right * (outputResolution / screenResolution);
exportRECT.bottom = activeView.ExportFrame.bottom * (outputResolution / screenResolution);
how do you figure the screen resolution?
Hi Xtian79,
I found out another way, please see the link: http://forums.arcgis.com/threads/69207-How-to-store-elements-of-IMap%28IGraphicsContainer%29-as-Bina...
Kind regards,