how do you figure the screen resolution?
Hi!!!, in the solution that you propose how do you figure the value of the screen resolution?, or is it just a random value? i trying to export an image to the printer, that information would be useful
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-BinaryData-format-in-SQL?p=245080&viewfull=1#post245080Kind regards,
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);
you are rigth, that's my mistake, you have to initialize the variable....
Thank you. But there is an error: Use of unassigned local variable 'myMapImage'Kind regards,Tai
Hi, basically one way is to draw layer by layer in an image object, then export it 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(); I hope this is helpful for you
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();
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.