help on scaleimage

BlitzPlus Forums/BlitzPlus Beginners Area/help on scaleimage

CloseToPerfect(Posted 2006) [#1]
can anyone tell me what I'm missing here?
I want to scale a image 10% each time and store it in a array, but I can't get it to work. I commented it out to work though it and it seems to make since, so I guess I don't understand how something works?

thanks, CTP

Dim ball_active_image(5) ; making ball array

ball_active_image(0) = ball_image ; setting 1st array slot

For i = 1 To 5 ; starting loop

h# = Float(i) ; changing int to float

g#= h#/10 ; making g# 10% bigger then h#

ball_image = ball_active_image(i-1) ; storeing image in array that will be inlarged

ScaleImage ball_active_image(i-1),g#,g# ; scaling image in array slot before this one 10% bigger

ball_active_image(i) = ball_active_image(i-1) ; setting this array slot to scaled image

ball_active_image(i-1) = ball_image ; restore image in array before this one to proper size

Next ; ending loop


b32(Posted 2006) [#2]
You should use CopyImage() to copy the image.


CloseToPerfect(Posted 2006) [#3]
Well, thank you, that worked, although, I had never used copyimage before, must have something to do with it in a loop, but I will start using copyimage just to make sure I don't have a snafu like that again.

Also there was one more problem my 10% bigger was just 10% it should have been 1+h#/10

Thank you,
CTP


b32(Posted 2006) [#4]
Hmm, or 1.1*h#? What you did before was assigning the image handle to another variable.
If you do this:
image = loadimage("bmp.bmp")
image2 = image,
only one image is loaded that can be accesed using both "image" and "image2".
If you try printing them, you see the image pointer's value are the same:
Print image
Print image2
CopyImage makes a "physical" copy of the image.