Platforms to show: All Mac Windows Linux Cross-Platform

Back to Picture class.

Picture.ExtractColorMBS(SearchColor as color, ReplaceWithColor as color, BackGroundColor as color) as picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 7.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Searches the first color and writes matching pixels with the secon color.
Example
dim p as Picture

p=New Picture(300,300,32)

p.Graphics.ForeColor=&cFF0000
p.Graphics.FillRect 000,100,100,100

p.Graphics.ForeColor=&c00FF00
p.Graphics.FillRect 100,100,100,100

p.Graphics.ForeColor=&c0000FF
p.Graphics.FillRect 200,100,100,100

p.Graphics.ForeColor=&c777700
p.Graphics.FillRect 100,200,100,100

// shows just a violet box on the left
backdrop=p.ExtractColorMBS(&cFF0000,&cFF00FF,&c000000)

All pixels which do not match the search color are written to the new picture using the given background color.
Returns nil on any error.

The items on this page are in the following plugins: MBS Picture Plugin.


The biggest plugin in space...