----------------------------------------------------------------------------------------------------------------------------------------------- 本文提示:《VB5.0中基于桌面的屏幕技巧(3)》是本站编辑们为广大网友精选的实用文章,本文阐述了关于文章的相关理论,相对来说专业性强,但是本文只是针对于某个问题提出的见解与论述,未必能辐射到相关问题的方方面面,所以本文处理问题的方法仅仅为您提供一些参考。更多问题请查阅学习中国网其他栏目哦. -----------------------------------------------------------------------------------------------------------------------------------------------
hSrcDC As Long, ByVal xSrc As Long,
ByVal ySrc As Long, ByVal
dwRop As Long) As Long
Private Declare Function GetDC
Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function Get
DesktopWindow Lib "user32" () As Long
Private Declare Function ReleaseDC
Lib "user32" (ByVal hwnd As Long,
ByVal hdc As Long) As Long
注释: 变 量 说 明
Dim sWnd, sDC, hd
注释: 直 接 演 示 特 技 效 果
Private Sub Form_Load()
注释: 置 窗 口 背 景 为 黑 色 无 边 框
注释:Form1.BackColor = 0
注释:Form1.BorderStyle = 0
注释: 修 改 窗 口 尺 寸 与 屏 幕 相 同
Form1.AutoRedraw = True
Form1.Width = Screen.Width
Form1.Height = Screen.Height
Form1.Top = 0
Form1.Left = 0
注释: 修 改PICTURE 尺 寸 与 屏 幕 相 同
Picture1.Width = Screen.Width
Picture1.Height = Screen.Height
Picture1.Top = 0
Picture1.Left = 0
注释: 获 得 桌 面 图 像 句 柄
sWnd = GetDesktopWindow()
sDC = GetDC(sWnd)
hd=BitBlt(Picture1.hdc,0,0,Form1.
Width,Form1.Height,sDC,0,0,&HCC0020)
hd = ReleaseDC(sWnd, sDC)
Picture1.Visible = False
Form1.Show
注释: 修 改IMAGE 尺 寸 与 屏 幕 相 同
Image1.Stretch = True
Image1.Picture = Picture1.Image
Image1.Width = Screen.Width
Image1.Height = Screen.Height
Image1.Top = 0
Image1.Left = 0
注释: 桌 面 逐 渐 缩 小
For i = 0 To Screen.Height / 35
Image1.Visible = False
Image1.Top = 15 * i
Image1.Left = 15 * i
Image1.Width = Screen.Width - 2 * Image1.Left
Image1.Height = Screen.Height - 2 * Image1.Top
Image1.Visible = True
DoEvents
Next i
Image1.Visible = False
注释: 随 机 位 置 显 示 桌 面
For i = 0 To 20
Dim ll As Integer
Dim tt As Integer
ll = Rnd(1) * Screen.Width - Screen.Width / 2
tt = Rnd(1) * Screen.Height - Screen.Height / 2
Form1.PaintPicture Picture1.
Image,ll,tt,Screen.Width,Screen.Height
DoEvents
Next i
注释: 显 示PICTURE 并 清 屏 幕
Picture1.Visible = True
Form1.Cls
注释: 横 向 移 动
For i = 0 To Screen.Width * 2 / 5
Picture1.Left = Picture1.Left + 5
If Picture1.Left > Screen.Width Then
Picture1.Left = -Screen.Width
End If
DoEvents
Next i
注释: 纵 向 移 动
For i = 0 To Screen.Height * 2 / 5
Picture1.Top = Picture1.Top + 5
If Picture1.Top > Screen.Height Then
Picture1.Top = -Screen.Height
End If
DoEvents
Next i
注释: 桌 面 上 显 示 文 字
For i = 0 To 50
With Picture1
.ScaleMode = 3 注释: 以 象 素 为 单 位
.FontTransparent = True
.Font.Size = Rnd * 30 + 10
.Font.Italic = True
.ForeColor = RGB(Rnd * 256, Rnd * 256, Rnd * 256)
.FontName = Screen.Fonts(Rnd * 7 + 14)
End With
hh = Picture1.TextHeight("OK DESKTOP 演 示")
ww = Picture1.TextWidth("OK DESKTOP 演 示")
X = Rnd * (Picture1.ScaleWidth - ww)
Y = Rnd * (Picture1.ScaleHeight - hh)
Picture1.Line(X-2,Y-2)-(X+ww+2,
Y+hh+2),RGB(Rnd*256,Rnd*256,Rnd*256),BF
Picture1.Line(X,Y)-(X+ww,Y+hh),
RGB(Rnd*256,Rnd*256,Rnd*256),BF
Picture1.CurrentX = X
Picture1.CurrentY = Y
Picture1.Print "OK DESKTOP 演 示"
DoEvents
Next i
注释: 桌 面 变 暗
Form1.Picture1.ScaleMode = 3 注释: 以 象 素 为 单 位
For j = 0 To Picture1.ScaleHeight / 2 本文章更多内容:<<上一页 - 1 - 2 - 3 - 4 - 下一页>>收藏到:[收藏夹] [百度搜藏] [新浪ViVi] [POCO网摘] [ 和讯网摘] [好哦网摘] [Google书签] [Yahoo书签] [搜狐网摘] [365Key网摘] [天极网摘] [我摘] [博采网摘] [igooi网摘] |