ArcGis Engine+c# 二次开发实用资料
export = new ESRI.ArcGIS.Output.ExportTIFFClass(); }
else if (outPath.EndsWith(".bmp"))
{
export = new ESRI.ArcGIS.Output.ExportBMPClass(); }
else if (outPath.EndsWith(".emf"))
{
export = new ESRI.ArcGIS.Output.ExportEMFClass(); }
else if (outPath.EndsWith(".png"))
{
export = new ESRI.ArcGIS.Output.ExportPNGClass(); }
else if (outPath.EndsWith(".gif"))
{
export = new ESRI.ArcGIS.Output.ExportGIFClass(); }
export.ExportFileName = outPath;
IEnvelope pEnvelope = pView.Extent;
//导出参数
export.Resolution = 300;
tagRECT exportRect = new tagRECT();
exportRect.left = exportRect.top = 0;
exportRect.right = outRect.Width;
exportRect.bottom = (int)(exportRect.right * pEnvelope.Height / pEnvelope.Width);
ESRI.ArcGIS.Geometry.IEnvelope envelope = new
ESRI.ArcGIS.Geometry.EnvelopeClass();
//输出范围
envelope.PutCoords(exportRect.left, exportRect.top,
exportRect.right, exportRect.bottom);
export.PixelBounds = envelope;
//可用于取消操作
ITrackCancel pCancel = new CancelTrackerClass();
export.TrackCancel = pCancel;
pCancel.Reset();
//点击ESC键时,中止转出
pCancel.CancelOnKeyPress = true;
pCancel.CancelOnClick = false;
pCancel.ProcessMessages = true;
//获取handle
System.Int32 hDC = export.StartExporting();
热门文档