|
-
Aug 6th, 2000, 05:22 PM
#1
Fanatic Member
HeSaidJoe
Code:
Sub Object_Paint(objSource as Object,objTarget as Object)
'This routine tiles an image (objSource) all over the target object (objTarget)
'objTarget could be Form1
'objSource could be Picture1
Dim X as Integer
'Set vertical loop
For Y = 0 To objTarget.Height Step picSource.Height
'Set horizontal loop
For X = 0 To objTarget.Width Step picSource.Width
'Draw the image at location x,y
objTarget.PaintPicture picSource, X, Y
'Draw next horizontal image until row is drawn
Next X
'Draw next vertical image until all columns drawn
Next Y
End Sub
When using the PAINTPICTURE method, if the keyword is not pre-fixed with an object name - an object that must support the paintpicture method) then the method is implied towards the form that contains the code (MDI Form? ...I can't remember), if the code is in a module and not in a form, AND the code is not pre-fixed with an object name of an object that supports the method then an error occurs.
When pre-fixing the keyword with an object name that does support the paint picture method (Form's, Picturebox's and CUSTOM controls, then the object background can be tiled.
And finally, not everyone is over the moon with naming conventions
DocZaf
{;->
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
|