VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 将图片「非重叠显示」填满整个表格视窗
发表评论(0)作者:不详, 平台:VB6.0+Win98, 阅读:10374, 日期:2002-02-06
将图片「非重叠显示」填满整个表格视窗
作者:-
----所需物件: PictureBox 一个。

----程式码(一):tile.bas
Declare Function BitBlt Lib "GDI" (ByVal hDestDC%, ByVal X%, ByVal Y%, _
ByVal nWidth%, ByVal nHeight%, ByVal hSrcDC%, ByVal XSrc%, ByVal YSrc%, _
ByVal dwRop&) As Integer

----程式码(二):
Sub Form_Paint ()
Const PIXEL = 3
Picture1.ScaleMode = PIXEL
Me.ScaleMode = PIXEL
X% = 0: Y% = 0
nWidth% = Picture1.Width
nHeight% = Picture1.Height
dwRop& = &HCC0020
Do While Y% < ScaleHeight
Do While X% < ScaleWidth
Suc% = BitBlt(Me.hDC, X%, Y%, nWidth%, nHeight%, Picture1.hDC, 0, 0, dwRop&)
X% = X% + nWidth%
Loop
X% = 0
Y% = Y% + nHeight%
Loop
End Sub