我正在尝试播放 .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)