How to insert a tiled picture inside a frame
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 'Controls - How to insert a tiled picture inside a frame 'Place a Picturebox on that frame (named Picture1) and another Picturebox '(named picBuffer). Change picBuffer Picture property to a desired picture 'and AutoSize property to TRUE. Put this on Picture1_Paint event: Private Sub Picture1_Paint() Dim X As Integer, Y As Integer Dim iImgWidth As Integer Dim iImgHeight As Integer Dim iPicWidth As Integer Dim iPicHeight As Integer picBuffer.Visible = False ScaleMode = vbPixels iImgWidth = picBuffer.Width iImgHeight = picBuffer.Height iPicWidth = Picture1.Width iPicHeight = Picture1.Height For X = 0 To iPicWidth Step iImgWidth For Y = 0 To iPicHeight Step iImgHeight Picture1.PaintPicture picBuffer.Picture, X, Y Next Y Next X End Sub |
Related posts:
- How to stretch picture in a picture box
- How to center a picture in Picture box Control
- How to Print the Picture to Printer
- How to Load any image in Picture box control
- How to center the Text in a picture box?
- How to select/remove picture in a picture box
- How to display a picture if you drag the Picture file to Picture Box
- How to stretch Picture Box
- How to Display Rotated text in Picture Box
- How to Spin a Picture