ArcGIS Engine 10 开发手册(10-2)矢量格式地图输出

本文目录
  • 正文

矢量格式文件的输出主要是依靠 IExportVector 接口,该接口被以下 5 个类实现:

输出EMF格式

private void ExportEMF ()

{

  IActiveView pActiveView;

  pActiveView = axPageLayoutControl1.ActiveView;
  IExport pExport;

  pExport = new ExportEMFClass ();

  pExport.ExportFileName = @"E:\arcgis\Engine\ExportEMF.emf";
  pExport.Resolution = 300;

  tagRECT exportRECT;

  exportRECT = pActiveView.ExportFrame;
  IEnvelope pPixelBoundsEnv;
  pPixelBoundsEnv = new EnvelopeClass ();

  pPixelBoundsEnv.PutCoords (exportRECT.left, exportRECT.top, exportRECT.right, exportRECT.bottom);

  pExport.PixelBounds = pPixelBoundsEnv;
  int hDC;

  hDC = pExport.StartExporting ();
  pActiveView.Output (hDC, (int) pExport.Resolution, ref exportRECT, null, null);

  pExport.FinishExporting ();
  pExport.Cleanup ();

}

输出PDF格式

private void ExportPDF ()

{

  IActiveView pActiveView;

  pActiveView = axPageLayoutControl1.ActiveView;
  IEnvelope pEnv;

  pEnv = pActiveView.Extent;
  IExport pExport;

  pExport = new ExportPDFClass ();

  pExport.ExportFileName = @"E:\arcgis\Engine\ExportPDF.pdf";
  pExport.Resolution = 30;

  tagRECT exportRECT;
  exportRECT.top = 0;

  exportRECT.left = 0;
  exportRECT.right = (int) pEnv.Width;

  exportRECT.bottom = (int) pEnv.Height;
  IEnvelope pPixelBoundsEnv;
  pPixelBoundsEnv = new EnvelopeClass ();

  pPixelBoundsEnv.PutCoords (exportRECT.left, exportRECT.bottom, exportRECT.right, exportRECT.top);

  pExport.PixelBounds = pPixelBoundsEnv;
  int hDC;

  hDC = pExport.StartExporting ();
  pActiveView.Output (hDC, (int) pExport.Resolution, ref exportRECT, null, null);

  pExport.FinishExporting ();
  pExport.Cleanup ();

}

ArcGIS Engine 10 开发手册全集

ArcGIS Engine 10 开发手册全集: ArcGIS Engine 10 开发手册

如果本文对你有所帮助,欢迎对我们团队进行打赏捐助,让我们在传播3S的路上可以走得更远。
赞赏支持
微信捐助麻辣GIS 支付宝捐助麻辣GIS

麻辣GIS-Sailor
作者:
GIS爱好者,学GIS,更爱玩GIS。

如您有疑问,可在文末留言,或到QQ群提问。

本站QQ群(一):291616564 麻辣GIS

本站QQ群(二):166408035 麻辣GIS(二)

微信公众号:malagis,扫描右边二维码直接关注。

发表评论