memory-saving image rotation

BlitzPlus Forums/BlitzPlus Beginners Area/memory-saving image rotation

Newcomer(Posted 2009) [#1]
I need help and here is my code:

Global image1 = LoadImage("image.bmp")

image2 = CopyImage(image1)
image3 = CopyImage(image2)
image4 = CopyImage(image3)
image5 = CopyImage(image4)
image6 = CopyImage(image5)
image7 = CopyImage(image6)
image8 = CopyImage(image7)

RotateImage image2, 45
RotateImage image3 90
RotateImage image4, 135
RotateImage image5, 180
RotateImage image6 225
RotateImage image7, 270
RotateImage image8, 315



my problem is that when I get to the line:

image2 = CopyImage(image1)

or any after that, I receive the message:

'Invalid image handle'

what is wrong with my program?


P.S. to explain the name, I am doing this so I can have my images rotate in the program instead of using up memory having 8 pictures pre-saved


Newcomer(Posted 2009) [#2]
......................./\........................
....................../..\.......................
...................../....\......................
..................../......\.....................
..................../......\.....................
.................../........\....................
.................../........\....................
................../..........\...................
................./............\..................
................./............\..................
................/..............\.................
.....................|...|.......................
.................................................


Ked(Posted 2009) [#3]
Make sure your image1 loaded successfully. And the tree was not needed.


Newcomer(Posted 2009) [#4]
I don't think it did, but what can I do to make sure it does.


Ked(Posted 2009) [#5]
Global image1 = LoadImage("image.bmp")
If Not image1 Then RuntimeError "NO IMAGE!!!!!"

image2 = CopyImage(image1)
image3 = CopyImage(image2)
image4 = CopyImage(image3)
image5 = CopyImage(image4)
image6 = CopyImage(image5)
image7 = CopyImage(image6)
image8 = CopyImage(image7)

RotateImage image2, 45
RotateImage image3 90
RotateImage image4, 135
RotateImage image5, 180
RotateImage image6 225
RotateImage image7, 270
RotateImage image8, 315



Newcomer(Posted 2009) [#6]
O.K. now im sure it doesn't exist. Do you know how to fix it?


Ked(Posted 2009) [#7]
...


Sauer(Posted 2009) [#8]
Make sure that "image.bmp" is in the same directory as your source.
Make sure that the source is saved, and not still "untitled".
Try it with a graphics mode set.


Newcomer(Posted 2009) [#9]
thank you sauer!!
thank you thank you thank you


ShadowTurtle(Posted 2009) [#10]
nice tree, newcomer