Once an image is BLOADed or gotten with GET, all of the data is in the array including the dimensions. Each piece of data can be manipulated using trig or just by reading the data differently.
Some people index the RGB color settings for the bitmap first, so you have to find the start of the image data and remember where to start and finish. The color data usually ends at index 47 in SCREEN 12. 767 in 13. So the width is at 48 and the height is at 49. Or 0 and 1 with the default colors like you are probably using.
To find the end of the data, you have to read the array backwards until you find the first value above 0. To do that and be sure it is not just black, PSET(width, Height), 15 and GET the image again. You could also use POINT to find the lower right corner color attribute. I hope you only BSAVEd the image and not black parts of the screen. The original bitmap header gave you the width and height to GET.
Code: Select all
IF POINT(width&, height&) = 0 THEN
PSET(width&, height&), 1
GET (width&, height&), Array(48) '0 if no RGB values indexed
END IF
Then use a reverse loop to find values that are greater than 0.
Code: Select all
FOR I = UBOUND(Array) to 0 STEP -1
IF Array(I) > 0 THEN maxindex = I : EXIT FOR
NEXT
Now you know the exact parts of the array that hold the data. You can then flip it, rotate it, whatever. To flip it, just read the array backwards.
Ted