I don't seem to find a TILE function in VB to repeat a small picture to make out for the entire background (such as building a form). Does anyone know how to do it in VB 6.0?
Here is a piece of code that will do it.
You need to load the small pic into a picture opject such as a image or picturebox before calling this function.
Also, cleanup the image or picturebox after this funtion.
Public Function TileObject(ByVal stdPct As Object, ByVal objTo As Object, wid As Single, hgt As Single)
On Error Resume Next
Dim x As Single
Dim y As Single
y = 0
Do While y < objTo.Height
x = 0
Do While x < objTo.Width
objTo.PaintPicture stdPct.Picture, x, y, wid, hgt
x = x + wid
Loop
y = y + hgt
Loop
Thanks for the tip. PaintPicture! That's great. It seems to me the duplicated pictures should not take up additional resources like objects since they are simple bitmaps. Is the overhead in placing them on form an issue (or in another word, how much performance & resources we commit to painting them in real time versus loading a full size picture that was pre-tiled into one file)?
I checked the blackbelt MDI package. It works and is a very good example to learn image programming with VB & API. Right now, it's a bit over me. Thanks for the link.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.