Flip Image

BlitzMax Forums/BlitzMax Beginners Area/Flip Image

BLaBZ(Posted 2012) [#1]
How do I flip an image horizontally before it gets drawn?

I thought using SetScale with negative values would work but no luck.


Jesse(Posted 2012) [#2]
of course it does!

note that it flips relative to the handle:


SuperStrict

Local image:TImage = CreateImage(100,100)
MidHandleImage (image)
Local imagePx:Int Ptr = Int Ptr(LockImage(image).pixels)
For Local i:Int = 0 Until image.width*image.height Step 101
	imagepx[i] = $FFFF0000
Next

Graphics 640,480

DrawImage image,100,100

SetScale -1,1
DrawImage image,100,250
Flip()
WaitKey()