以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  保存图片报错  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=153682)

--  作者:ehbx_ysj
--  发布时间:2020/8/19 14:08:00
--  保存图片报错

        Dim pbx As WinForm.PictureBox = Forms("选择产品").Controls("PictureBox1")
        If pbx.Image IsNot Nothing Then
            Dim path As String =ProjectPath & "tempImg"
            If FileSys.DirectoryExists(path) = False Then \'
                FileSys.CreateDirectory(path)
            End If
            Dim fl As String =  path  & "\\JCCP_" & .Current("sys_ID") & ".jpg"
            If FileSys.FileExists(fl) Then
              FileSys.DeleteFile(fl)  
            End If
            pbx.Image.save(fl)                      
        End If
图片点击可在新窗口打开查看

去掉 pbx.Image.save(fl)   代码正常 
[此贴子已经被作者于2020/8/19 14:10:38编辑过]

--  作者:有点蓝
--  发布时间:2020/8/19 14:15:00
--  
换一个方式试试

pbx.Image.save(fl) 
改为
Dim bmp  = new bitmap(pbx.Image)
bmp.save(fl)

--  作者:ehbx_ysj
--  发布时间:2020/8/19 14:17:00
--  
可行 问题解决