Delphi版 ArcEngine 10种格式地图输出方法

 1 function  ExportMapToFile(pActiveView: IActiveView; filetypes: FileType; fileName:  string ): Boolean;
 2 var
 3   pExport: IExport;
 4   iOutputResolution: SmallInt;
 5   iScreenResolution: SmallInt;
 6   exportRect: tagRECT;
 7   pPixelBounds: IEnvelope;
 8   hdc: Integer;
 9
10   pExportPdf: IExportPDF;
11 begin
12    case  filetypes  of
13     ftBmp: pExport : =  CoExportBMP.Create  as  IExport;
14     ftGif: pExport : =  CoExportGIF.Create  as  IExport;
15     ftJpg: pExport : =  CoExportJPEG.Create  as  IExport;
16     ftSvg: pExport : =  CoExportSVG.Create  as  IExport;
17     ftEps: pExport : =  CoExportPS.Create  as  IExport;
18     ftPng: pExport : =  CoExportPNG.Create  as  IExport;
19     ftEmf: pExport : =  CoExportEMF.Create  as  IExport;
20     ftAI: pExport : =  CoExportAI.Create  as  IExport;
21     ftTif: pExport : =  CoExportTiff.Create  as  IExport;
22     ftPdf:
23        begin
24         pExport : =  CoExportPdf.Create  as  IExport;
25         pExportPdf : =  pExport  as  IExportPDF;
26         pExportPdf.EmbedFonts : =  True;
27         pExportPdf.ImageCompression : =  esriExportImageCompressionLZW;
28         pExportPdf.Compressed : =  True;
29        end ;
30    end ;
31
32    if  Length(fileName)  =   0   then
33    begin
34     Result : =  False;
35     Exit;
36    end ;
37
38   pExport.ExportFileName : =  fileName;
39   iScreenResolution : =   96 ;
40   iOutputResolution : =   300 ;
41
42   pPixelBounds : =  CoEnvelope.Create  as  IEnvelope;
43   exportRect.left : =   0 ;
44   exportRect.top : =   0 ;
45   exportRect.right : =  pActiveView.ExportFrame.right  *  Round(iOutputResolution  /  iScreenResolution);
46   exportRect.bottom : =  pActiveView.ExportFrame.bottom  *  Round(iOutputResolution  /  iScreenResolution);
47
48   pPixelBounds.PutCoords(exportRect.left, exportRect.top, exportRect.right, exportRect.bottom);
49
50   pExport.PixelBounds : =  pPixelBounds;
51
52   hdc : =  pExport.StartExporting;
53   pActiveView.Output(hdc, Round(pExport.Resolution), exportRect, pActiveView.Extent,  nil );
54   pExport.FinishExporting;
55   pExport.Cleanup;
56   Result : =  True;
57 end ;

转载于:https://www.cnblogs.com/chinacodegear/archive/2009/03/14/1411685.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值