Results 1 to 4 of 4

Thread: Can I tile a picture in Form1.Picture?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Ont, Canada, Earth
    Posts
    458
    Hi,
    I wanted to use a picture smaller than my form and tile it like on window's desktop. How can I do it?
    Thanks.
    Thanks

    Tomexx.

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'tile an image on a form
    
    '1) Place an image control on a form and give it a picture
    '2) Set the forms AutoRedraw to False
    '3) Place this code in the Form Paint Event
    
    Dim intX As Integer
    Dim intY As Integer
    
    For intX = 0 To Me.Width Step Image1.Width
        	For intY = 0 To Me.Height Step Image1.Height
            	PaintPicture Image1, intX, intY
        	Next intY
    Next intX
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Guest

    Talking

    TRY THIS, ITS NOT MY WORK BUT IT WORKS FOR ME!
    Just give it the form and the picture box with the bitmap and away it will go.
    Obviously you will need to set autorefresh to true on the form if you want to keep the tile effect when another window
    moves over it......


    Public Function TileBitmap(ByVal TheForm As Form, ByVal theBitmap As PictureBox)


    Dim iAcross As Integer
    Dim iDown As Integer
    theBitmap.AutoSize = True
    For iDown = 0 To (TheForm.Width \ theBitmap.Width) + 1
    For iAcross = 0 To (TheForm.Height \ theBitmap.Height) + 1

    '===========This section should be all one line;-)=======
    TheForm.PaintPicture theBitmap.Picture, iDown * theBitmap.Width, iAcross * theBitmap.Height, theBitmap.Width, theBitmap.Height
    '========================================================

    Next iAcross, iDown

    End Function

  4. #4
    Guest

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width