ImageMan.Net Version 3 Summer 2012 Release
GetMonochromeBlackPixelCount(ImImage) Method
See Also  Example Send Feedback
DTI.ImageMan Namespace > Analyze Class > GetMonochromeBlackPixelCount Method : GetMonochromeBlackPixelCount(ImImage) Method





img
ImImage to Process

Glossary Item Box

Get The Total Monochrome Black Pixel Count for the image.

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Function GetMonochromeBlackPixelCount( _
   ByVal img As ImImage _
) As System.Integer
Visual Basic (Usage)Copy Code
Dim img As ImImage
Dim value As System.Integer
 
value = Analyze.GetMonochromeBlackPixelCount(img)
C# 
public static System.int GetMonochromeBlackPixelCount( 
   ImImage img
)
JScript 
public static function GetMonochromeBlackPixelCount( 
   img : ImImage
) : System.int;
Managed Extensions for C++ 
public: static System.int GetMonochromeBlackPixelCount( 
   ImImage* img
) 
C++/CLI 
public:
static System.int GetMonochromeBlackPixelCount( 
   ImImage^ img
) 

Parameters

img
ImImage to Process

Return Value

long pixel count for image.

Remarks

This function returns a total count of all the black pixels in the image.

The following managed cpp code calculates the ratio of black pixels to white pixels in a value between 0 and 1.0:
int pixels = GetMonochromeBlackPixelCount(img);
float pixelRatio = (float)pixels / (float)(img->Width * img->Height);

Example

The following managed cpp code calculates the ratio of black pixels to white pixels in a value between 0 and 1.0:
C#Copy Code
int pixels = GetMonochromeBlackPixelCount(img);
float pixelRatio = (float)pixels / (float)(img->Width * img->Height);

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2014 Data Techniques, Inc. All Rights Reserved.