Results 1 to 3 of 3

Thread: Need tiled picture inside a frame

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309

    Post

    I want to have a frame with somekind of control inside that can display pictures. I want that control to always have the size of the frame, and the picture inside the control should be tiled.... How can I do this ??

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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:
    Code:
    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
    Regards,

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]




    [This message has been edited by Serge (edited 11-01-1999).]

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309

    Post

    Cheers Serge,

    Any ideas on how to reduce flickering ??

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