CSDN博客

img dnvodcwan

如何平铺图片

发表于2004/9/16 14:00:00  702人阅读

分类: VB技术类

你可以Form上放置一个PictureBox,将Visible属性设为FalseAutoSize属性设为True。将PictureBoxPicture属性设置为你需要的图片。然后在Form_Paint事件中输入如下代码:

Private Sub Form_Paint()

Dim wid As Single

Dim hgt As Single

Dim x As Single

Dim y As Single

 

wid = Picture1.ScaleWidth

hgt = Picture1.ScaleHeight

y = 0

Do While y < ScaleHeight

x = 0

Do While x < ScaleWidth

PaintPicture Picture1.Picture, _

x, y, wid, hgt

x = x + wid

Loop

y = y + hgt

Loop

End Sub

阅读全文
0 0

相关文章推荐

img
取 消
img