以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  为什么图像上传至ftp后,不能在picturebox中显示?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=116199)

--  作者:ycwk
--  发布时间:2018/3/21 10:13:00
--  为什么图像上传至ftp后,不能在picturebox中显示?
文件来源都设置了,就是绑定那里 没有设置,设置成对应的 附件  字段,也没有用  ,不好意思再次发贴,因为比较着急


Dim myGraphics As Graphics = basemainform.CreateGraphics()
Dim s As new Size(2000, 1000) \'截取的大小
Dim bit As New Bitmap(s.Width, s.Height, myGraphics)
Dim memoryGraphics As Graphics = Graphics.FromImage(bit)
memoryGraphics.CopyFromScreen(0, 0, 0, 0, s) \'截取的开始位置,坐标(100, 200)


Dim str_serialno As String =  e.Form.Controls("TB_日常问题ID").value & "_" & Format(Date.now, "yyMMddhhmmss") & ".jpg"


bit.save(ProjectPath & "RemoteFiles\\" & str_serialno)    \'保存图片到本地
msgbox(ProjectPath & "RemoteFiles\\" & str_serialno)

\'上传到FTP服务器
Dim ftp1 As new ftpclient 
ftp1.host="172.16.5.13" 
ftp1.Account = "075"
ftp1.password = "075"
ftp1.upload(ProjectPath & "RemoteFiles\\" & str_serialno,"/李朝阳/" & str_serialno,True) \'上传


Tables("自助报障记录表").Current("问题描述附件")= str_serialno     \'在"自助报障记录表"中保存上述图片路径
Tables("自助报障记录表").current.Save    


bit.Dispose()     \'丢弃资源,不知道是否起作用

MessageBox.Show("截图成功", "提示",MessageBoxButtons.Ok,MessageBoxIcon.Question, 0, Windows.forms.MessageBoxOptions.ServiceNotification)     \'模态窗口提示


Dim pbx As WinForm.PictureBox
pbx = Forms("软件自助报障系统窗口").Controls("PictureBox1")
pbx.SizeMode = ImageSizeMode.Zoom
pbx.Image = GetImage(ProjectPath & "RemoteFiles\\" & str_serialno)


--  作者:有点甜
--  发布时间:2018/3/21 11:41:00
--  

pictureBox控件,不要绑定表列,不然无法直接设置image属性。

 

如果要绑定,那直接设置修改 Tables("自助报障记录表").Current("问题描述附件") 的值即可。