Vb.net从本地驱动器加载图片 [英] Vb.net load picture from local drive

查看:149
本文介绍了Vb.net从本地驱动器加载图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

通常我将我的图片/图片添加到vb中的资源文件夹中..

因此加载图片更容易



但是这次我尝试从harddisc加载它



任何人都可以请更正我的代码
因为无法加载



谢谢



什么我试过了:



Panel1.BackgroundImage = Image.FromFile(TransparentBackground)

解决方案

试试这个



  Dim  filePath  As  字符串 
filePath = D:/img/image1.png ' 您的图片路径
.Panel1.BackgroundImage = System.Drawing.Image.FromFile(f ilePath)


hello
Usually i add my picture(s) / image(s) into my resources folder in vb..
so it was easier to load the picture

but this time i try to load it from harddisc

can anyone please correct my code
cause it can't be load

thank you

What I have tried:

Panel1.BackgroundImage = Image.FromFile("TransparentBackground")

解决方案

try this

Dim filePath As String
       filePath = "D:/img/image1.png" ' your image path 
       Me.Panel1.BackgroundImage = System.Drawing.Image.FromFile(filePath)


这篇关于Vb.net从本地驱动器加载图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆