如何在vb中打开gif动画图片??

如何在vb中打开gif动画图片??,第1张

不行的,image没有句柄,如果你觉得这个效果不怎么好就去下载控件吧,比较好的就是Gif89dll了
===============================
可以用控件实现,但是有些gif播放不出或者播放出的不是想要的效果,楼上的倒是个不错的方法
下面的有个无控件的方法,不过也是有点问题,你参考下吧,代码下载:

用Timer控件切换Image控件里的就OK了
假设添加Timer1,暂停和开始按钮这么写
Timer1Enabled
=
Not
Timer1Enabled

楼主你好!
可以按以下步骤:

1、打开VB60,新建标准EXE

2、打开之后,单机属性窗口,选择按分类序。

3、找到外观-Palette,就可以上传动态了(支持bmp,gif,dib)

三个Picturebox控件,一个定时器控件timer1
Private Sub Timer1_Timer()
Static PicNo As Integer
Picture1Visible = False
Picture2Visible = False
Picture3Visible = False
Select (PicNo)
Case 0
Picture1Visible = True
Case 1
Picture2Visible = True
Case 2
Picture3Visible = True
End Select
PicNo = PicNo + 1
End Sub
Private Sub Form_Load
Timer1Interval = 1000
Timer1Enabled = True
End Sub

把照片从1-520 编号号码
Option Explicit
Private Sub Form_Load()
MeWidth = ScreenWidth
MeHeight = ScreenHeight
MeTop = 0
MeLeft = 0
Image1Top = 0
Image1Left = 0
Image1Width = MeWidth
Image1Height = MeHeight
End Sub
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Shift = 2 Then
Unload Me
End If
End Sub
Private Sub Timer1_Timer()
Static i As Integer
Dim f As String
i = i + 1
If i = 521 Then i = 1
f = AppPath & "\" & i & "jpg"
Image1Picture = LoadPicture(f)
End Sub

如果是,可以这样处理:加载Timer控件和Image控件
Private Sub Form_Load()
Timer1Interval = 2000
End Sub
Private Sub Timer1_Timer()
X = DatePart("S", Time)
If X <= 8 Then‘时间可以自己设定
strTemp = AppPath & "\1JPG"
ElseIf X <= 16 And X > 8 Then
strTemp = AppPath & "\2JPG"
ElseIf X <= 24 And X > 16 Then
strTemp = AppPath & "\3JPG"
ElseIf X <= 32 And X > 24 Then
strTemp = AppPath & "\4JPG"
ElseIf X <= 40 And X > 32 Then
strTemp = AppPath & "\5JPG"
ElseIf X <= 48 And X > 40 Then
strTemp = AppPath & "\6JPG"
ElseIf X <= 56 And X > 48 Then
strTemp = AppPath & "\7JPG"
ElseIf X <= 60 And X > 56 Then
strTemp = AppPath & "\8JPG"
End If
Image1Picture = LoadPicture(strTemp)
End Sub


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/13375702.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-07-24
下一篇 2023-07-24

发表评论

登录后才能评论

评论列表(0条)

保存