Picture methods

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

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.


💬 Ask a question or report a problem