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.CountColorMBS(col as color) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Counts the pixels with the given colors.
Example
dim p as Picture
dim n1,n2 as Integer

p=New Picture(300,300,32)

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

n1=p.CountColorMBS(&cFF0000)
n2=p.CountColorMBS(&cFFFFFF)

if n1=100*100 then
if n2=300*300-100*100 then
MsgBox "OK"
else
MsgBox "white failed"
end if
else
MsgBox "red failed"
end if

Returns the number of pixels found.

Blog Entries

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


💬 Ask a question or report a problem