发布网友 发布时间:2022-05-09 18:15
共1个回答
热心网友 时间:2023-10-12 04:50
Option Explicit Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Const WS_EX_LAYERED = &H80000 Const GWL_EXSTYLE = (-20) Const LWA_ALPHA = &H2 Const LWA_COLORKEY = &H1 Private ImgB As Image Private Sub Form_Load() Dim a As StdPicture Me.Move 0, 0, Screen.Width, Screen.Height Set ImgB = Me.Controls.Add("VB.Image", "ImgB") ImgB.Visible = True ImgB.Move 0, 0 Set a = LoadPicture("C:\WINDOWS\system32\setup.bmp") SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_LAYERED SetLayeredWindowAttributes Me.hwnd, &H0, 255, LWA_ALPHA Or LWA_COLORKEY Me.BackColor = 0 ImgB.Picture = LoadPicture("C:\windows\system32\setup.bmp") End Sub 黑色的部分屏蔽掉,并显示在屏幕上,但是用VB作动画类的东西不是很好, 因为VB本身只支持一种“动画”,就是AVI。。。。。。