Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Mosaics effects like SuperNes ( need memblocks )

Author
Message
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 6th Jan 2003 12:39
with memblocks , you will now be able to make mosaics effects just like Super Mario world does.

You should change the load image with 1 image you choose.

use is quite simple.
Just use 1 function :
Flx_Mosaic(_source,_cible,_facteur)
_source = source bitmap that contain the original image
_target = target bitmap that'll contain the mosaic
_factor = mosaic factor ( >0 and 1 and _key0
make memblock from bitmap _memblock,_bitmapsource
xsize=memblock dword(_memblock,0) : ysize=memblock dword(_memblock,4)
depth=memblock dword(_memblock,8) : _length=get memblock size(_memblock)
if depth=16
for ypos=0 to ysize-_factor step _factor
for xpos=0 to xsize-_factor step _factor
_read=12+(xpos*2+(ypos*xsize*2))
_pixel=memblock word(_memblock,_read)
if _factor=2
write memblock word _memblock,_read+2,_pixel
write memblock word _memblock,_read+(xsize*2),_pixel
write memblock word _memblock,_read+(xsize*2)+2,_pixel
endif
if _factor>2
for ysb=0 to _factor-1
for xsb=0 to _factor-1
_write=_read+(xsb*2)+(ysb*xsize*2)
write memblock word _memblock,_write,_pixel
next xsb
next ysb
endif
next xpos
next ypos
endif
make bitmap from memblock _bitmaptarget,_memblock
delete memblock _memblock
endif
endfunction
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 10th Jan 2003 01:14
I h
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 10th Jan 2003 01:15
sorry.
I have problems posting source code !
there are always parts that disappear on the post !
not good !

here is the full source code corrected :

Login to post a reply

Server time is: 2024-04-23 08:34:10
Your offset time is: 2024-04-23 08:34:10