zoukankan      html  css  js  c++  java
  • ArcEngine导出图片 转载

    原文链接http://bbs.gissky.net/blog.asp?id=114

    ArcEngine中导出图片的过程如下:
    1.建立导出类(IExport的实例);
    2.准备要导出的范围
    3.开始导出(从导出类中获取DC)
    4.调用IActiveView的Output方法
    5.结束导出
    6.清除导出类
    范例代码如下:
          //获取保存文件的路径/建立导出类
       System.Windows.Forms.SaveFileDialog sfd=new SaveFileDialog();
       sfd.Filter="*.tif|*.tif|*.jpeg|*.jpeg|*.pdf|*.pdf|*.bmp|*.bmp";
       if(sfd.ShowDialog((Form)this.m_appRef)==DialogResult.OK)
       {
        IExport pExport=null;
        if(1==sfd.FilterIndex)
        {
         pExport=new ExportTIFFClass();
        } 
        else if(2==sfd.FilterIndex)
        {
         pExport=new ExportJPEGClass();
        } 
        else if(3==sfd.FilterIndex)
        {
         pExport=new ExportPDFClass();
        } 
        else if(4==sfd.FilterIndex)
        {
         pExport=new ExportBMPClass();
        } 
        pExport.ExportFileName=sfd.FileName;
        设置参数
        //默认精度              
        int reslution=96;    
        pExport.Resolution = reslution;
        //获取导出范围
        tagRECT exportRECT=m_pActiveView.ExportFrame;
        IEnvelope pPixelBoundsEnv =new EnvelopeClass();
        pPixelBoundsEnv.PutCoords(exportRECT.left, exportRECT.top, exportRECT.right, exportRECT.bottom);
        pExport.PixelBounds = pPixelBoundsEnv;
        //开始导出,获取DC  
        int hDC = pExport.StartExporting();
        IEnvelope pVisbounds=null;
        ITrackCancel ptrac=null;
        //导出
        m_pActiveView.Output(hDC,(int)pExport.Resolution,ref exportRECT, pVisbounds, ptrac);
        //结束导出
        pExport.FinishExporting();
        //清理导出类
        pExport.Cleanup(); 

  • 相关阅读:
    ubuntu segmentation fault 段错误
    css配合js模拟的select下拉框
    让IE6下支持固定定位
    max-height,min-height在IE下不支持的解决方法
    图片居中
    完美运动框架,随意调用,兼容性好
    JS创建Ajax的XMLHttpRequest对象的通用方法
    JS兼容性问题(FF与IE)
    css样式
    html之marquee详解[转]
  • 原文地址:https://www.cnblogs.com/hl3292/p/1914069.html
Copyright © 2011-2022 走看看