Foxtable(狐表)用户栏目专家坐堂 → 关于压缩图片问题


  共有2123人关注过本帖树形打印复制链接

主题:关于压缩图片问题

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:109682 积分:558114 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/8/16 8:59:00 [显示全部帖子]

Dim file As String = "e:\test.jpg"
Dim img As image = getImage(file)
Dim bmp As bitmap
If img.width > 600 Then
    If 600 * (img.height / img.width) > 338 Then
        bmp = new bitmap(img, 600*(338/(600*(img.height/img.width))), 338)
    Else
        bmp = new bitmap(img, 600, 600 * (img.height / img.width))
    End If
    bmp.save("e:\缩略图.jpg",img.RawFormat)
    bmp.Dispose
End If


 回到顶部