[Gambas-user] Image class and histogram

Benoît Minisini gambas at ...1...
Sun Mar 13 03:49:50 CET 2011


> For Image.Equalize and Image.Normalize, the color values (histogram) of the
> image must be internally read.
> 
> Would it be possible to access those data? I would like to draw a
> histogram. Right now, I can't find any method of image class that would
> let me read the color values.
> 
> Regards
> Matti
> 

I implemented the Image.Histogram() method in the gb.image.effect component 
(revision #3647). 

It works like that:

Dim hImage as Image
Dim hHist As ImageHistogram

hHist = hImage.Histogram()
Print hHist[<Channel>, <Value>]

<Channel> is Image.Red, Image.Blue, Image.Green or Image.Alpha.
<Value> must be between 0 and 255.

Can you test it?

-- 
Benoît Minisini




More information about the User mailing list