VB.net调用Resources资源的问题?
PrivateSubButton5_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesBu...
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim PicPath As String
PicPath = My.Resources.流体流速推荐.tif
Shell("rundll32.exe C:\WINDOWS\system32\shimgvw.dll,ImageView_Fullscreen " & PicPath)
End Sub
可是咋一直不成功的,请高手看看哪里有写的不对的 展开
Dim PicPath As String
PicPath = My.Resources.流体流速推荐.tif
Shell("rundll32.exe C:\WINDOWS\system32\shimgvw.dll,ImageView_Fullscreen " & PicPath)
End Sub
可是咋一直不成功的,请高手看看哪里有写的不对的 展开
2个回答
展开全部
资源这个东西很抽象,你要把它写进文件里头
比如说,写入exe同目录吧
If Not System.IO.File("ltlstj.tif") Then
My.Resources.流体流速推荐.tif.Save("ltlstj.tif")
End If
PicPath = Application.StartUpPath & "\ltlstj.tif"
然后再进行调用
手机写的,难免有错误,不好意思
比如说,写入exe同目录吧
If Not System.IO.File("ltlstj.tif") Then
My.Resources.流体流速推荐.tif.Save("ltlstj.tif")
End If
PicPath = Application.StartUpPath & "\ltlstj.tif"
然后再进行调用
手机写的,难免有错误,不好意思
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2018-03-22
展开全部
目标不匹配,文件是图像,picPath是String,可以
dim myPic as image
myPic=My.Resources.流体流速推荐
dim memoStream as new System.IO.MemoryStream
myPic.Save(memoStream, myPic.RawFormat)
dim picData(memoStream.Length) as byte
memoStream.Seek(0, IO.SeekOrigin.Begin)
memoStream.Read(picData,0,memoStream.Length)
IO.File.WriteAllBytes(IO.Path.Combine(AppDomin.CurrentDomin.BaseDirectory,"流体流速推荐.tif"), picData)'将内存中的图像文件创建到当前路径
system.diagnostics.process.start(io.path.combine(Appdomin.currentdomin.basedirectory &"流体流速推荐.tif"))'系统调用自身程序打开
dim myPic as image
myPic=My.Resources.流体流速推荐
dim memoStream as new System.IO.MemoryStream
myPic.Save(memoStream, myPic.RawFormat)
dim picData(memoStream.Length) as byte
memoStream.Seek(0, IO.SeekOrigin.Begin)
memoStream.Read(picData,0,memoStream.Length)
IO.File.WriteAllBytes(IO.Path.Combine(AppDomin.CurrentDomin.BaseDirectory,"流体流速推荐.tif"), picData)'将内存中的图像文件创建到当前路径
system.diagnostics.process.start(io.path.combine(Appdomin.currentdomin.basedirectory &"流体流速推荐.tif"))'系统调用自身程序打开
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询