平铺图片(例27)
Option Explicit Dim i As Integer, j As Integer Private Sub fullpic() For j = 0 To Me.Height Step Pic1.ScaleHeight For i = 0 To Me.Width Step Pic1.ScaleWidth Me.PaintPicture Pic1.Picture, i, j Next i Next j End Sub Private Sub form_paint() Call fullpic End Sub 当最大化图片的时候报错,实时错误6,溢出,因为Dim i As Integer,图片宽度已经超出整型范围,所以换成long之后程序运行出来了,但是还有个问题没有解决,图片框和form不等宽的时候,实现平铺效果时上面还有一张原始图片。 来源: CSDN 作者: 李赛男 链接: https://blog.csdn.net/lisainan66/article/details/103948617