# Re: 各位高手救救我吧!!一个有关FORM的问题!~~很急!~救命ㄚ!

Posted by Honey on June 02, 1999 at 20:35:41:

In Reply to: 各位高手救救我吧!!一个有关FORM的问题!~~很急!~救命ㄚ! posted by Chih on June 02, 1999 at 08:21:34:

'事先取得在萤幕上的图案 放在picture1上
'用timer1调整form及picture1的相对位置
'知道原理后记的把表单的线框取消 看起来才完全是透明的
'在表单上放一个PICTURE1 , Timer1
'Timer的Interval根据需要设定
'Picture1的AutoRedraw = True

Option Explicit
Private Declare Function _
BitBlt Lib "gdi32" (ByVal _
hDestDC As Long, ByVal X _
As Long, ByVal Y As Long, _
ByVal nWidth As Long, ByVal _
nHeight As Long, ByVal _
hSrcDC As Long, ByVal xSrc _
As Long, ByVal ySrc As _
Long, ByVal dwRop As Long) _
As Long
Private Declare Function _
ReleaseDC Lib "user32" _
(ByVal hWnd As Long, ByVal _
hDC As Long) As Long
Private Declare Function _
GetDC Lib "user32" (ByVal hWnd _
As Long) As Long

Private Sub Form_Load()
Dim SCRhDC As Long
Dim X As Long
Dim Y As Long
Picture1.AutoRedraw = True
Me.Hide
DoEvents
Picture1.Width = _
Screen.Width
Picture1.Height = _
Screen.Height
SCRhDC = GetDC(0)

X = Screen.Width \ _
Screen.TwipsPerPixelX
Y = Screen.Height \ _
Screen.TwipsPerPixelY

BitBlt Picture1.hDC, 0, 0, _
X, Y, SCRhDC, 0, 0, vbSrcCopy

ReleaseDC 0, SCRhDC
Me.AutoRedraw = False
Me.Show
Picture1.Top = -Me.Top
Picture1.Left = -Me.Left
End Sub

Private Sub Timer1_Timer()
Picture1.Top = -Me.Top - (Me.Height - Me.ScaleHeight)
Picture1.Left = -Me.Left - (Me.Width - Me.ScaleWidth)
End Sub

Follow Ups: