Oops, i forgot to mention:
[DBPro and DBC]
This simple function will resize an image to the specified size using sprites. It supports images that are up to 4000x4000 in size (doubt you'd even need one that big) Anyway here's the function (semi-poorly commented):
rem Declare our function.
function ResizeImage(IMAGE,SizeX,SizeY)
rem Check for free/unused bitmap numbers.
R_B=0
repeat
inc R_B
until Bitmap Exist(R_B)=0
rem Check for free/unused sprite numbers.
R_S=0
repeat
inc R_S
until Sprite Exist(R_S)=0
rem Create a bitmap using out free bitmap number.
Create Bitmap R_B,4000,4000
rem Create a sprite from the image using our free sprite number.
Sprite R_S,0,0,IMAGE
rem Resize the sprite to the size specified.
Size sprite R_S,SizeX,SizeY
rem Put our new resized sprite on the bitmap.
paste sprite R_S,0,0
rem Overwrite the old image with our new one.
Get Image IMAGE,0,0,SizeX,SizeY
rem Delete the extra-media that this function made.
delete sprite R_S
delete bitmap R_B
rem End of function.
endfunction
And here's a example. It will turn a 256x256 image into a 64x64 image:
rem Create a demo image. It'll be a green square with a red line in the middle.
create bitmap 1,256,256
ink rgb(0,255,0),0
for l = 0 to 100
if L>30 and L<70 then ink rgB(255,0,0),0 else ink rgb(0,255,0),0
line 0,l,100,l
next l
get image 1,0,0,256,256
delete bitmap 1
rem Paste the image and some text
sync
set cursor 300,300
print "ORIGINAL SIZE."
paste image 1,0,0
sync
suspend for key
rem Clear the screen.
cls
rem Resize the image using our function.
ResizeImage(1,64,64)
rem Show the reduced size.
sync
set cursor 300,300
print "SMALLER SIZE."
paste image 1,0,0
sync
suspend for key
rem End of program.
end
rem Declare our function.
function ResizeImage(IMAGE,SizeX,SizeY)
rem Check for free/unused bitmap numbers.
R_B=0
repeat
inc R_B
until Bitmap Exist(R_B)=0
rem Check for free/unused sprite numbers.
R_S=0
repeat
inc R_S
until Sprite Exist(R_S)=0
rem Create a bitmap using out free bitmap number.
Create Bitmap R_B,4000,4000
rem Create a sprite from the image using our free sprite number.
Sprite R_S,0,0,IMAGE
rem Resize the sprite to the size specified.
Size sprite R_S,SizeX,SizeY
rem Put our new resized sprite on the bitmap.
paste sprite R_S,0,0
rem Overwrite the old image with our new one.
Get Image IMAGE,0,0,SizeX,SizeY
rem Delete the extra-media that this function made.
delete sprite R_S
delete bitmap R_B
rem End of function.
endfunction
Hope this comes in handy for somebody
Please respond...