MZ JavaScript: Horizontally Flipping A Bitmap?

I have the following PNG (button_arrow):

uc


Upon start of the game, it gets loaded into $dataGui._bitmaps.button_arrow.main[0]-
uc


As a Bitmap, it has canvas and image properties-
uc


Per this StackOverflow post, it seems to be possible to flip an image horizontally using JavaScript-
uc


I am trying to apply their logic to the following function, that processes button_arrow.png before it is loaded into the $datGui._bitmaps object-
uc


The function attempts to create four new bitmaps from button_arrow.png-
uc
uc
uc
uc


But I am unsuccessful thus far.

Doth anybody have any insights, suggestions, or corrections for how I might achieve my goal?

TIA 🙂


UPDATE (2022.05.25 23:52)

Got it working after coming across this piece of advice from another thread and adapting it-
uc


Thanks 🙂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/javascript-horizontally-flipping-a-bitmap.147909/