How do I mirror a 2D image?

Blitz3D Forums/Blitz3D Beginners Area/How do I mirror a 2D image?

I don't think it's his signature image, Ross, because his older sigs haven't changed; Blitz forum sigs are retroactive, not sticky.

Um... Am I the only one who thinks this issue is being made WAY MORE COMPLICATED than it needs to be? Seriously, GitTech seems to have the right idea. Look, try this; it's just 12 lines, really easy, and even has its own error-catcher.

Function MirrorImage(ImageToMirror,FlipDirection)


Local MirroredImage = CopyImage(ImageToMirror)


If FlipDirection = 1;horizontal, left-to-right flip
    ScaleImage MirroredImage,-1,1
ElseIf FlipDirection = 2;vertical, top-to-bottom flip
    ScaleImage MirroredImage,1,-1
Else
    RuntimeError "The flip type has to be 1 or 2. You entered " + FlipDirection + ", doofus. XD"
EndIf


Return MirroredImage


End Function


;Code example - MirrorImage() in action
Global Image1 = LoadImage("image.bmp")
Global Image2 = MirrorImage(Image1,1)
Global Image3 = MirrorImage(Image1,2)


There, that should do ya. Anyway, whatever you end up using, good luck!