当前位置: 源码素材网 » VB教程 » 详情页

VB ICON图片转换成JPG格式

  •   时间:2019-09-02
  • 概述:图片转换 格式转换

VB ICON 转 Picture,将ICO图标图像转换成JPG图片格式,这是一个函数,使用范围广,函数代码如下:

Public Function IconToPicture(hIcon As Long) As IPictureDisp
    Dim cls_id As CLSID
    Dim hRes As Long
    Dim new_icon As TypeIcon
    Dim lpUnk As IUnknown
    With new_icon
        .cbSize = Len(new_icon)
        .picType = vbPicTypeIcon
        .hIcon = hIcon
    End With
    With cls_id
        .id(8) = &HC0
        .id(15) = &H46
    End With
    Dim CA As ColorConstants
    hRes = OleCreatePictureIndirect(new_icon, cls_id, 1, lpUnk)
    If hRes = 0 Then Set IconToPicture = lpUnk
End Function

    相关声明:

      若“VB ICON图片转换成JPG格式”有损您的权益,请告之我们删除内容。
      部分文章来源于网络,版权归原作者所有。