cl991036
管理员
管理员
  • 注册日期2003-07-25
  • 发帖数5917
  • QQ14265545
  • 铜币29669枚
  • 威望217点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • GIS帝国铁杆
阅读:2099回复:3

导出透明背景色图片

楼主#
更多 发布于:2009-01-19 15:52
<P>透明原理:将TransparentColor属性的RGB设置为地图背景色一样的值,2个颜色叠加,得到透明效果</P><P>Private Sub UIBtnCtl_ExportPNG_Click()<BR>On Error GoTo PROC_ERROR<BR>    Dim pMxDocument As IMxDocument<BR>    Dim pMap As IMap<BR>    <BR>    Set pMxDocument = Application.Document<BR>    Set pMap = pMxDocument.FocusMap<BR>    <BR>    Dim pAv As IActiveView<BR>    Set pAv = pMap<BR>    Dim pExport As IExport<BR>    Set pExport = New ExportPNG<BR>    Dim pPngExport As IExportPNG<BR>    Set pPngExport = New ExportPNG<BR>    pPngExport.TransparentColor.RGB = RGB(192, 230, 250)<BR>    pPngExport.TransparentColor.Transparency = 0<BR>    pPngExport.TransparentColor.NullColor = False<BR>    Set pExport = pPngExport<BR>    <BR>    Dim pSavePath As String<BR>    pSavePath = "c:/pic.png"<BR>    Dim exportFrame As tagRECT<BR>    exportFrame = pAv.exportFrame<BR>    Dim hdc;, dpi;<BR>    Dim pEnv As IEnvelope<BR>    Set pEnv = New Envelope<BR>    pEnv.PutCoords exportFrame.Left, exportFrame.Top, exportFrame.Right, exportFrame.bottom<BR>    <BR>    dpi = CLng(pExport.Resolution)<BR>    pExport.PixelBounds = pEnv<BR>    pExport.ExportFileName = pSavePath<BR>    pExport.Resolution = dpi<BR>    <BR>    hdc = pExport.StartExporting<BR>    pAv.Output hdc, dpi, exportFrame, Nothing, Nothing<BR>    pExport.FinishExporting<BR>    MsgBox "导出完毕!"<BR>    <BR>    Exit Sub<BR>PROC_ERROR:<BR>    MsgBox Err.Description<BR>End Sub<BR><BR></P>
喜欢0 评分0
没钱又丑,农村户口。头可断,发型一定不能乱。 邮箱:gisempire@qq.com
cafecat
路人甲
路人甲
  • 注册日期2003-07-29
  • 发帖数375
  • QQ
  • 铜币894枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2009-01-19 15:58
<P>呵呵,不错,搜藏了          </P>
http://3s2go.blogspot.com/
举报 回复(0) 喜欢(0)     评分
xxx1030
路人甲
路人甲
  • 注册日期2006-02-15
  • 发帖数47
  • QQ
  • 铜币273枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2009-01-23 10:36
<P><STRONG>导出透明背景色图片</STRONG><BR></P>
<P>是什么意思,这样得到什么效果?</P>
举报 回复(0) 喜欢(0)     评分
chenjunfc
外卖仔
外卖仔
  • 注册日期2003-08-14
  • 发帖数58
  • QQ283832077
  • 铜币452枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2009-03-17 14:15
早贴出来嘛,害得我自己研究两周才搞出来
举报 回复(0) 喜欢(0)     评分
游客

返回顶部