Click to See Complete Forum and Search --> : Mosaic BMP files


November 23rd, 1999, 03:44 PM
Does anyone know how to mosaic BMP files to be the background of my form? I am making an RPG and this is vital to the game. thanks

November 23rd, 1999, 04:11 PM
Use Bitblt (Windows API) in a loop. They should have somethiing about bitblt on this site. Use it like

for horizontal = 0 to screen.width
for vertical = 0 to screen.height
' bitblt your picture here
next vertical
next horizontal



This process is called tiling and you can find numerous articles about it on the net.

Ravi Kiran
November 23rd, 1999, 09:16 PM
Have a form with AutoRedraw Property set to False.
Add a image control to it and set its Picture property to the BMP that you want to tile on the form. Then out this repaint code

private Sub Form_Paint()
Dim ii as Long, jj as Long
Dim lpPic as Picture, wid as Long, hgt as Long
With Image1
set lpPic = .Picture
wid = .Width
hgt = .Height
End With
ii = 0: jj = 0
Do
ii = 0
Do
me.PaintPicture lpPic, ii, jj
ii = ii + wid
Loop While ii < me.Width
jj = jj + hgt
Loop While jj < me.Height
End Sub




RK