View Single Post
Old 05-20-2019, 01:11 PM   #523
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
how do you revert bitmap to its original state/color?
I'm trying JS_LICE_AlterBitmapHSV
Besides the obvious solution of just saving the original bitmap and switching between them, you can use any invertible transformation. AFAIK, in the case of HSV, saturation and value aren't reversible, since they can bump against max and min values. Hue, on the other hand, is a continuous ring that will wrap around when it reaches the maximum, so if you use AlterHSV with any +hue, just use -hue to revert the change.

Another option is to use ProcessRect in XOR mode, since XOR is invertible. Just XOR with any number (0x00FFFFFF will nicely invert the colors without changing alpha) and then XOR again to revert.
juliansader is offline   Reply With Quote