-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|390|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Graphical Effects


 
Andy_A
Created : 26 February 2008
 
System : Windows
Language : Blitz

Fast Image Color Replacement

Good way to change sprite colors in real time

This code represents what I've been doing in MS Paint while working on sprites.

Even on detailed images you can replace colors in Paint like this:

1)Load the image where you want to replace a color with another

2)Using the "Color Picker" (eye dropper icon), right-click on the color you want to replace and then left-click the new color on "Color Palette".

3) In the "Edit" menu click "Select-All", then "Cut" (Ctrl-A then Ctrl-X"

4) Click the "Fill" icon (paint bucket) and click on the canvas. This fills the canvas with the "new" color which replaces the old color.

5)In the "Edit" menu click "Paste" (Ctrl-V)

6)Below the tool bar icons there are two graphics, click the lowermost graphic (this masks the background color which was chosen in step 2)

Voila! The old color was instantly replaced with the new color.

This snippet does the same thing in Blitz. So now you can have for example, one image strip to represent an insane number of different colored sprites.


 

Comments