vb.net - 在访问 PictureBox vb net 时显示/显示/检索图像(文件路径)
问题描述
我真的对这部分感到困惑。我可以用图片框保存5张图片,但只是图片所在的文件路径。现在我真的很困惑向图片框显示 5 张图片并打印它们。任何人都可以帮助我任何代码?我只需要代码来将我的图片显示到图片框但带有文件路径并打印它们。请帮助我:(我尝试使用此代码,但我不知道如何将图片检索到图片框
Private Sub search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles search.Click
command.Connection = con
command = New OleDbCommand("Select * from datagambar Where NoFaktur = '" & nofaktur.Text & "'")
datareader = command.ExecuteReader
datareader.Read()
If datareader.HasRows Then
PictureBox1.ImageLocation = datareader.Item("FakturInvoice") 'untuk mencari lokasi gambar pada direktori
PictureBox2.ImageLocation = datareader.Item("SPB&BAPP")
PictureBox3.ImageLocation = datareader.Item("PurchaseOrder")
PictureBox4.ImageLocation = datareader.Item("TandaTerimaInvoice")
PictureBox5.ImageLocation = datareader.Item("FakturPajak")
Else
MsgBox("There's No Image For NoFaktur '" & nofaktur.Text & "'")
End If
解决方案
推荐阅读
- amazon-web-services - Beanstalk 节点应用程序:如何将 https://mypage.com 或 http://mypage.com 重定向到 https://www.mypage.com?
- c - libc stat 函数和 LuaJIT
- python - 在数据框的每一天开始时添加一行
- c++ - Herb Sutter 关于将虚函数设为私有的文章
- php - 在保持键布局的同时合并 JSON
- javascript - 如何让一个物体跟随另一个物体一定距离?
- html - 在链接中使用图像时,图像不会按百分比缩放
- python - arg、kwarg 拆包规则
- webpack - Webpack 将别名解释为路径字符串
- kubernetes - Kubernetes:PersistentVolumeClaim 错误,Forbidden:创建后不可变,但绑定声明的 resources.requests 除外