明眸心
路人甲
路人甲
  • 注册日期2006-04-21
  • 发帖数5
  • QQ
  • 铜币129枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:905回复:0

[求助]帮我看看这个输出图片的代码!

楼主#
更多 发布于:2007-10-29 17:30
<P>主要是想输出PageLayoutControl的当前视图为JPG图片,不过不想要PageLayoutControl中设置的框线,不过我怎么改参数都有那个包含地图的框。郁闷!</P>
<P>Dim pActiveView As IActiveView<BR>      Set pActiveView = PageLayoutControl1.ActiveView<BR>      Dim pEnv As IEnvelope<BR>      Set pEnv = New Envelope<BR>      With pEnv<BR>                    .XMin = 2.8919<BR>                   .YMin = 8.7233<BR>                   .Width = 15.2136<BR>                   .Height = 12.2502<BR>      End With<BR>     pActiveView.Extent = pEnv<BR>       pActiveView.Refresh<BR>        '输出设置<BR>        Dim pExport As IExport<BR>        Set pExport = New ExportJPEG<BR>        '设置输出文件名称<BR>        pExport.ExportFileName = "d:\6.jpg"<BR>      <BR>     <BR>        Dim iOutputResolution As Integer<BR>       Dim iScreenResolution As Integer<BR>         iScreenResolution = 96  'default screen resolution is usually 96dpi<BR>        iOutputResolution = 192<BR>        pExport.Resolution = iOutputResolution<BR>        <BR>          <BR>        Dim exportRECT As tagRECT<BR>        With exportRECT<BR>    .Left = 0<BR>    .Top = 0<BR>    .Right = pActiveView.ExportFrame.Right * (iOutputResolution / iScreenResolution)<BR>    .Bottom = pActiveView.ExportFrame.Bottom * (iOutputResolution / iScreenResolution)<BR>  <BR>  End With</P>
<P>    <BR>        Dim pEnvelop As IEnvelope<BR>        Set pEnvelop = New Envelope<BR>        pEnvelop.PutCoords exportRECT.Left, exportRECT.Top, exportRECT.Right, exportRECT.Bottom<BR>        pExport.PixelBounds = pEnvelop<BR>    <BR>        Dim hDC As Long<BR>        hDC = pExport.StartExporting<BR>    <BR>        pActiveView.Output hDC, pExport.Resolution, exportRECT, Nothing, Nothing<BR>        <BR>     pExport.FinishExporting</P>
喜欢0 评分0
游客

返回顶部