假設有5張圖片 播完1張圖片 進行淡入 載入新圖片 進行淡出 這樣效果 要如何做
我只知道將background 做淡入淡出的語法 me.opacity+=0.01
但使圖片要如何做呢??
高手交一下 3Q
2006-09-16 11:12:15 · 2 個解答 · 發問者 蔥頭 2 in 電腦與網際網路 ➔ 程式設計
'沒加註解怕超過2K字,可用AlphaBlend為關鍵字上Google查使用方法!'表單置2個PictureBox並且各放入2張不同圖片,及另置1個Timer。'本範例只示範2張圖之淡入淡出,至於您要5張圖去切換就請自行變通啦XD。Private Type rB tP As Byte tT As Byte tA As Byte tY As ByteEnd TypePrivate Declare Sub AlphaBlend Lib "msimg32.dll" (ByVal D&, ByVal X&, ByVal Y&, ByVal W&, ByVal H&, ByVal S&, ByVal xS&, ByVal yS&, ByVal wS&, ByVal hS&, ByVal B&)Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (D As Any, Source As Any, ByVal L&)Private Sub Form_Activate() Picture1.AutoRedraw = True: Picture1.ScaleMode = 3 Picture2.AutoRedraw = True: Picture2.ScaleMode = 3 Timer1.Interval = 10: Timer1 = TrueEnd SubPrivate Sub Timer1_Timer() Dim R As rB, L& Static I% I = I + 1 Picture1.Cls R.tA = I CopyMemory L, R, 4 With Picture2 AlphaBlend Picture1.hdc, 0, 0, .ScaleWidth, .ScaleHeight, .hdc, 0, 0, .ScaleWidth, .ScaleHeight, L End With Picture1.Refresh Caption = Int(I / 2.55) & "%" If I >= 255 Then Timer1 = FalseEnd Sub
2006-09-16 19:18:38 · answer #1 · answered by W.J.S. 7 · 0⤊ 0⤋
不同圖片切換時的淡入淡出效果:http://vb-helper.com/howto_net_blend_animation.html
2006-09-16 23:03:17 · answer #2 · answered by ? 7 · 0⤊ 0⤋