GetBitDepth Method (GdPictureImaging)
Returns the bit depth (Bits per Pixel) of a GdPicture image.
public int GetBitDepth(
int
)
public function GetBitDepth(
: Integer
): Integer;
public function GetBitDepth(
: int
) : int;
public: int GetBitDepth(
int
)
public:
int GetBitDepth(
int
)
'Declaration
Public Function GetBitDepth( _
ByVal As Integer _
) As Integer
Parameters
- ImageID
- GdPicture image identifier.
Return Value
Can be:
1. For 1 bit per pixel image.
4. For 4 bits per pixel image.
8. For 8 bits per pixel image.
16. For 16 bits per pixel image.
24. For 24 bits per pixel image.
32. For 32 bits per pixel image.
48. For 48 bits per pixel image.
64. For 64 bits per pixel image.
Removing staple marks on 1bpp b&w image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.bmp");
if ((gdpictureImaging.GetBitDepth(imageID) == 1) && gdpictureImaging.IsBitonal(imageID, 0))
{
gdpictureImaging.RemoveStapleMark(imageID);
gdpictureImaging.SaveAsTIFF(imageID, "image.tif", TiffCompression.TiffCompressionCCITT4);
}
// Release used resources.
gdpictureImaging.ReleaseGdPictureImage(imageID);
}