以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]想达到上传图片的同时产生缩略图, (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=171031) |
-- 作者:林月 -- 发布时间:2021/8/14 21:51:00 -- [求助]想达到上传图片的同时产生缩略图, 想达到上传图片到e:\\web\\images\\uploadfiles的同时产生缩略图e:\\web\\images\\缩略图, 缩略图产生的代码不知道怎么加,麻烦老师帮我诊断一下 For Each key As String In e.Files.Keys If key = "up3" Then Dim lst As List(of String) = dra.Lines("照片") For Each fln As String In e.Files(key) Dim n As String = Format(Date.Now,"yyyyMMddHHmmssffff") & fln e.SaveFile(key, fln, "e:\\web\\images\\uploadfiles\\" & n) lst.Add(n) Next dra.Lines("照片") = lst End If Next Dim file As String = fln Dim img As image = getImage(file) Dim bmp As new bitmap(img, 100, 100 * (img.height / img.width)) bmp.save("e:\\web\\images\\缩略图\\n") bmp.Dispose |
-- 作者:有点蓝 -- 发布时间:2021/8/15 20:21:00 -- For Each key As String In e.Files.Keys If key = "up3" Then Dim lst As List(of String) = dra.Lines("照片") For Each fln As String In e.Files(key) Dim n As String = Format(Date.Now,"yyyyMMddHHmmssffff") & fln e.SaveFile(key, fln, "e:\\web\\images\\uploadfiles\\" & n) lst.Add(n) Dim file As String = "e:\\web\\images\\uploadfiles\\" & n Dim img As image = getImage(file) Dim bmp As new bitmap(img, 100, 100 * (img.height / img.width)) bmp.save("e:\\web\\images\\缩略图\\" & n) bmp.Dispose Next dra.Lines("照片") = lst End If Next |