vb窗口中平铺背景图片的方法

作者在 2007-09-02 05:42:00 发布以下内容

Private Sub Form_Paint()  '窗口重绘过程(当窗体从无到有,窗口变大都会激发该过程)
    Dim X As Integer, Y As Integer
    Dim ImgWidth     As Integer
    Dim ImgHeight     As Integer
    Dim FrmWidth     As Integer
    Dim FrmHeight     As Integer
    '初始化
    ImgWidth = Image1.Width
    ImgHeight = Image1.Height
    FrmWidth = Me.Width
    FrmHeight = Me.Height
    '开始平铺
    For X = 0 To FrmWidth Step ImgWidth
        For Y = 0 To FrmHeight Step ImgHeight
            PaintPicture Image1, X, Y
        Next Y
    Next X

End Sub

默认分类 | 阅读 2435 次
文章评论,共0条
游客请输入验证码
浏览592332次