批量出图 报错 200多张图后 m_export.FinishExporting();报错
SaveFileDialog m_save = new SaveFileDialog();
m_save.Filter = "jpeg图片(*.jpg)|*.jpg|tiff图片(*.tif)|*.tif|bmp图片(*.bmp)|*.bmp|emf图片(*.emf)|*.emf|png图片(*.png)|*.png|gif图片(*.gif)|*.gif";
m_save.ShowDialog();
string Outpath = m_save.FileName;
if (Outpath != "")
{
//分辨率
double resulotion = MapControl.ActiveView.ScreenDisplay.DisplayTransformation.Resolution;
IExport m_export = null;
if (Outpath.EndsWith(".jpg"))
{
m_export = new ExportJPEG() as IExport;
}
else if (Outpath.EndsWith(".tig"))
{
m_export = new ExportTIFF() as IExport;
}
else if (Outpath.EndsWith(".bmp"))
{
m_export = new ExportBMP() as IExport;
}
else if (Outpath.EndsWith(".emf"))
{
m_export = new ExportEMF() as IExport;
}
else if (Outpath.EndsWith(".png"))
{
m_export = new ExportPNG() as IExport;
}
else if (Outpath.EndsWith(".gif"))
{
m_export = new ExportGIF() as IExport;
}
//设置输出的路径
m_export.ExportFileName = Outpath;
//设置输出的分辨率
m_export.Resolution = resulotion;
tagRECT piexPound;
piexPound = MapControl.ActiveView.ScreenDisplay.DisplayTransformation.get_DeviceFrame();
IEnvelope m_envelope = new Envelope() as IEnvelope;
m_envelope.PutCoords(piexPound.left, piexPound.bottom, piexPound.right, piexPound.top);
//设置输出的IEnvelope
m_export.PixelBounds = m_envelope;
ITrackCancel m_trackCancel = new CancelTracker();
//输出的方法
MapControl.ActiveView.Output(m_export.StartExporting(), (short)resulotion, ref piexPound, MapControl.ActiveView.Extent, m_trackCancel);
m_export.FinishExporting();
m_save.Filter = "jpeg图片(*.jpg)|*.jpg|tiff图片(*.tif)|*.tif|bmp图片(*.bmp)|*.bmp|emf图片(*.emf)|*.emf|png图片(*.png)|*.png|gif图片(*.gif)|*.gif";
m_save.ShowDialog();
string Outpath = m_save.FileName;
if (Outpath != "")
{
//分辨率
double resulotion = MapControl.ActiveView.ScreenDisplay.DisplayTransformation.Resolution;
IExport m_export = null;
if (Outpath.EndsWith(".jpg"))
{
m_export = new ExportJPEG() as IExport;
}
else if (Outpath.EndsWith(".tig"))
{
m_export = new ExportTIFF() as IExport;
}
else if (Outpath.EndsWith(".bmp"))
{
m_export = new ExportBMP() as IExport;
}
else if (Outpath.EndsWith(".emf"))
{
m_export = new ExportEMF() as IExport;
}
else if (Outpath.EndsWith(".png"))
{
m_export = new ExportPNG() as IExport;
}
else if (Outpath.EndsWith(".gif"))
{
m_export = new ExportGIF() as IExport;
}
//设置输出的路径
m_export.ExportFileName = Outpath;
//设置输出的分辨率
m_export.Resolution = resulotion;
tagRECT piexPound;
piexPound = MapControl.ActiveView.ScreenDisplay.DisplayTransformation.get_DeviceFrame();
IEnvelope m_envelope = new Envelope() as IEnvelope;
m_envelope.PutCoords(piexPound.left, piexPound.bottom, piexPound.right, piexPound.top);
//设置输出的IEnvelope
m_export.PixelBounds = m_envelope;
ITrackCancel m_trackCancel = new CancelTracker();
//输出的方法
MapControl.ActiveView.Output(m_export.StartExporting(), (short)resulotion, ref piexPound, MapControl.ActiveView.Extent, m_trackCancel);
m_export.FinishExporting();
0 个回复