0

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

1 回答 1

0

一直在努力

Private GIFAnim As Image = My.Resources.book.gif

工作正常

于 2013-06-18T05:56:19.850 回答