Marblecore Imaging Library Documentation

Documentation Introduction
Documentation / Marblecore Imaging / Methods / InsertHistogram

InsertHistogram method

Inserts the histogram graph of the image on the specified position in the image.

Syntax

Boolean InsertHistogram(nLeft As Number, nTop As Number, nWidth As Number, nHeight As Number, nBackgroundColor As Number, nGraphColor As Number, nBackgroundOpacity As Number, nGraphOpacity As Number, nChannel As Channel)

Return value

Returns true if the function succeeded.

Parameters

ParameterTypeRequiredDescription
nLeftNumberYesSpecifies the horizontal coordinate where the histogram needs to be inserted.
nTopNumberYesSpecifies the vertical coordinate where the histogram needs to be inserted.
nWidthNumberNoOptional parameter which specifies the width of the histogram.
nHeightNumberNoOptional parameter which specifies the height of the histogram.
nBackgroundColorNumberNoOptional parameter which specifies the graph background color.
nGraphColorNumberNoOptional parameter which specifies the graph bar color.
nBackgroundOpacityNumberNoOptional parameter which specifies the opacity of the graph background.
nGraphOpacityNumberNoOptional parameter which specifies the opacity of the graph bar.
nChannelChannel (Enumeration)NoOptional parameter which specifies the color channel.

Example

The example below shows the effect of this method and how to use it. You can slide the marker in the before/after picture to see the difference. If you take a look at the example code, assume there is a reference to the Marblecore Imaging object with the name 'MarblecoreImaging'. Transparent parts of the image are displayed using a checkerboard pattern.
 
before
after
 
1 // Load the specified image in memory
2 MarblecoreImaging.LoadFromFile("example-inserthistogram-before.jpg");
3 
4 // Execute the operation
5 MarblecoreImaging.InsertHistogram(490, 423, 300, 100);
6 
7 // Save the modified image to the specified file
8 MarblecoreImaging.SaveToFile("example-inserthistogram-after.jpg");

Category

Histogram

See also

GetHistogramAverage | GetHistogramCount | GetHistogramMean | GetHistogramPercentile | GetHistogramPixels | LoadHistogramFromBase64 | LoadHistogramFromFile | LoadHistogramFromSerializedStream | LoadHistogramFromStream | LoadHistogramFromURL | SaveHistogramToFile | SaveHistogramToImage | SaveHistogramToSerializedStream | SaveHistogramToStream