我正在尝试播放.gif图像,但我遇到了找到正确路径的问题。我假设我不应该在我的计算机上使用C:\,因为它不适用于另一台计算机。我必须返回一个字符串,不知道为什么这么难。
代码:
Private GIFAnim As Image = Image.FromFile(Resources\book.gif)'<--- Error
Private frames As Integer
我试过了:
Private GIFAnim As Image = Image.FromFile(bin\book.gif)
和
Private Sub btnTurnFwrd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTurnFwrd.Click
Private GIFAnim As Image = Image.FromFile(theGif)
Dim theGif As String = Application.ExecutablePath
theGif = theGif.Substring(0, _
file_name.LastIndexOf("\bin")) & _
"\book.gif"
frames = GIFAnim.GetFrameCount(Imaging.FrameDimension.Time)
ImageAnimator.Animate(GIFAnim, AddressOf paintFrame)
End Sub
和
Private GIFAnim As Image = Image.FromFile(My.Resources.book.gif)
答案 0 :(得分:0)
试图努力
Private GIFAnim As Image = My.Resources.book.gif
工作正常