PDA

Click to See Complete Forum and Search --> : Need tiled picture inside a frame


Inhumanoid
Oct 31st, 1999, 06:51 PM
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 ??

Serge
Oct 31st, 1999, 07:33 PM
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


Regards,

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

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com




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

Inhumanoid
Oct 31st, 1999, 08:14 PM
Cheers Serge,

Any ideas on how to reduce flickering ??