| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 438 人关注过本帖
标题:[借花献佛]一个有意思有程序
只看楼主 加入收藏
freeforever
Rank: 4
等 级:业余侠客
威 望:3
帖 子:368
专家分:201
注 册:2005-11-2
结帖率:66.67%
收藏
 问题点数:0 回复次数:0 
[借花献佛]一个有意思有程序

实在没有上传了。我自己现写的程序都大了点,文件也分的多,不好上传,就把以前一个朋友的代码拿给大家:
Option Explicit

Private Declare Function GetDC Lib "user32" ( _
ByVal hwnd As Long) As Long

Private Declare Function ReleaseDC Lib "user32" ( _
ByVal hwnd As Long, _
ByVal hdc As Long) As Long

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 lngDC As Long
Private blnLOOP As Boolean

Private Sub Form_Click()
blnLOOP = False
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
blnLOOP = False
End Sub

Private Sub Form_Load()
Dim intX As Integer, intY As Integer
Dim intI As Integer, intJ As Integer
Dim intWidth As Integer, intHeight As Integer

intWidth = Screen.Width / Screen.TwipsPerPixelX
intHeight = Screen.Height / Screen.TwipsPerPixelY

frmMain.Top = 0
frmMain.Left = 0
frmMain.Width = Screen.Width
frmMain.Height = Screen.Height

lngDC = GetDC(0)

Call BitBlt(Me.hdc, 0, 0, intWidth, intHeight, lngDC, 0, 0, vbSrcCopy)

frmMain.Visible = True
frmMain.AutoRedraw = False

Randomize

blnLOOP = True

Do While blnLOOP

intX = (intWidth - 128) * Rnd
intY = (intHeight - 128) * Rnd

intI = 2 * Rnd - 1
intJ = 2 * Rnd - 1

Call BitBlt(frmMain.hdc, intX + intI, intY + intJ, 128, 128, frmMain.hdc, intX, intY, vbSrcCopy)

DoEvents
Loop

Set frmMain = Nothing
Call ReleaseDC(0, lngDC)
End
End Sub

搜索更多相关主题的帖子: 借花献佛 
2006-08-03 01:43
快速回复:[借花献佛]一个有意思有程序
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.029282 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved