|
-
Aug 18th, 2000, 09:05 AM
#1
Thread Starter
Hyperactive Member
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.
-
Aug 18th, 2000, 09:12 AM
#2
_______
<?>
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
-
Aug 18th, 2000, 09:16 AM
#3
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
-
Aug 18th, 2000, 09:17 AM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|