以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  这个压缩照片的,报错?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=67166)

--  作者:zgjmost
--  发布时间:2015/4/19 16:56:00
--  这个压缩照片的,报错?

Dim tpath As String = ProjectPath & "处理数据\\毕业照片(姓名证书编号命名)\\"

For Each File As String In FileSys.GetFiles(tpath)
    Dim img As image = getImage(file)
    Dim bmp As new bitmap(img, 160, 120 * (img.height / img.width))
    bmp.save(ProjectPath & "处理数据\\毕业照片(姓名证书编号命名压缩)\\")
    bmp.Dispose
Next

 

 

 


图片点击可在新窗口打开查看此主题相关图片如下:20150419.jpg
图片点击可在新窗口打开查看

--  作者:狐狸爸爸
--  发布时间:2015/4/19 21:14:00
--  

测试通过:

 

Dim tpath As String = "C:\\data\\毕业照片"
For Each File As String In FileSys.GetFiles(tpath)
    Dim img As image = getImage(file)
    Dim bmp As new bitmap(img, 160, 120 * (img.height / img.width))
    bmp.save("c:\\data\\缩略图\\" & filesys.GetName(file))
    bmp.Dispose
Next

 

 

注意Save必须包括文件名和路径,你原来只是指定了路径


--  作者:zgjmost
--  发布时间:2015/4/19 21:26:00
--  
谢谢