C# 클래스 AForge.Imaging.Image

Core image relatad methods.
All methods of this class are static and represent general routines used by different image processing classes.
파일 보기 프로젝트 열기: noxryan/Claro-Shader 1 사용 예제들

공개 메소드들

메소드 설명
Clone ( Bitmap source ) : Bitmap

Clone image.

The original Bitmap.Clone() does not produce the desired result - it does not create an actual clone (it does not create a copy of the image). That is why this method was implemented to provide the functionality.

Clone ( Bitmap source, PixelFormat format ) : Bitmap

Clone image.

The original Bitmap.Clone() does not produce the desired result - it does not create a clone with specified pixel format. More of it, the original method does not create an actual clone - it does not create a copy of the image. That is why this method was implemented to provide the functionality.

Clone ( BitmapData sourceData ) : Bitmap

Clone image.

Convert16bppTo8bpp ( Bitmap bimap ) : Bitmap

Convert bitmap with 16 bits per plane to a bitmap with 8 bits per plane.

The routine does the next pixel format conversions: Format16bppGrayScale to Format8bppIndexed with grayscale palette; Format48bppRgb to Format24bppRgb; Format64bppArgb to Format32bppArgb; Format64bppPArgb to Format32bppPArgb.

Convert8bppTo16bpp ( Bitmap bimap ) : Bitmap

Convert bitmap with 8 bits per plane to a bitmap with 16 bits per plane.

The routine does the next pixel format conversions: Format8bppIndexed (grayscale palette assumed) to Format16bppGrayScale; Format24bppRgb to Format48bppRgb; Format32bppArgb to Format64bppArgb; Format32bppPArgb to Format64bppPArgb.

CreateGrayscaleImage ( int width, int height ) : Bitmap

Create and initialize new 8 bpp grayscale image.

The method creates new 8 bpp grayscale image and initializes its palette. Grayscale image is represented as Format8bppIndexed image with palette initialized to 256 gradients of gray color.

FromFile ( string fileName ) : Bitmap

Load bitmap from file.

The method is provided as an alternative of System.Drawing.Image.FromFile(string) method to solve the issues of locked file. The standard .NET's method locks the source file until image's object is disposed, so the file can not be deleted or overwritten. This method workarounds the issue and does not lock the source file.

Sample usage:

Bitmap image = AForge.Imaging.Image.FromFile( "test.jpg" );
IsGrayscale ( Bitmap image ) : bool

Check if specified 8 bpp image is grayscale.

The methods checks if the image is a grayscale image of 256 gradients. The method first examines if the image's pixel format is Format8bppIndexed and then it examines its palette to check if the image is grayscale or not.

SetGrayscalePalette ( Bitmap image ) : void

Set pallete of the 8 bpp indexed image to grayscale.

The method initializes palette of Format8bppIndexed image with 256 gradients of gray color.

비공개 메소드들

메소드 설명
FormatImage ( Bitmap &image ) : void

메소드 상세

Clone() 공개 정적인 메소드

Clone image.
The original Bitmap.Clone() does not produce the desired result - it does not create an actual clone (it does not create a copy of the image). That is why this method was implemented to provide the functionality.
public static Clone ( Bitmap source ) : Bitmap
source System.Drawing.Bitmap Source image.
리턴 System.Drawing.Bitmap

Clone() 공개 정적인 메소드

Clone image.
The original Bitmap.Clone() does not produce the desired result - it does not create a clone with specified pixel format. More of it, the original method does not create an actual clone - it does not create a copy of the image. That is why this method was implemented to provide the functionality.
public static Clone ( Bitmap source, PixelFormat format ) : Bitmap
source System.Drawing.Bitmap Source image.
format PixelFormat Pixel format of result image.
리턴 System.Drawing.Bitmap

Clone() 공개 정적인 메소드

Clone image.
public static Clone ( BitmapData sourceData ) : Bitmap
sourceData System.Drawing.Imaging.BitmapData Source image data.
리턴 System.Drawing.Bitmap

Convert16bppTo8bpp() 공개 정적인 메소드

Convert bitmap with 16 bits per plane to a bitmap with 8 bits per plane.

The routine does the next pixel format conversions: Format16bppGrayScale to Format8bppIndexed with grayscale palette; Format48bppRgb to Format24bppRgb; Format64bppArgb to Format32bppArgb; Format64bppPArgb to Format32bppPArgb.

Invalid pixel format of the source image.
public static Convert16bppTo8bpp ( Bitmap bimap ) : Bitmap
bimap System.Drawing.Bitmap Source image to convert.
리턴 System.Drawing.Bitmap

Convert8bppTo16bpp() 공개 정적인 메소드

Convert bitmap with 8 bits per plane to a bitmap with 16 bits per plane.

The routine does the next pixel format conversions: Format8bppIndexed (grayscale palette assumed) to Format16bppGrayScale; Format24bppRgb to Format48bppRgb; Format32bppArgb to Format64bppArgb; Format32bppPArgb to Format64bppPArgb.

Invalid pixel format of the source image.
public static Convert8bppTo16bpp ( Bitmap bimap ) : Bitmap
bimap System.Drawing.Bitmap Source image to convert.
리턴 System.Drawing.Bitmap

CreateGrayscaleImage() 공개 정적인 메소드

Create and initialize new 8 bpp grayscale image.
The method creates new 8 bpp grayscale image and initializes its palette. Grayscale image is represented as Format8bppIndexed image with palette initialized to 256 gradients of gray color.
public static CreateGrayscaleImage ( int width, int height ) : Bitmap
width int Image width.
height int Image height.
리턴 System.Drawing.Bitmap

FromFile() 공개 정적인 메소드

Load bitmap from file.

The method is provided as an alternative of System.Drawing.Image.FromFile(string) method to solve the issues of locked file. The standard .NET's method locks the source file until image's object is disposed, so the file can not be deleted or overwritten. This method workarounds the issue and does not lock the source file.

Sample usage:

Bitmap image = AForge.Imaging.Image.FromFile( "test.jpg" );
public static FromFile ( string fileName ) : Bitmap
fileName string File name to load bitmap from.
리턴 System.Drawing.Bitmap

IsGrayscale() 공개 정적인 메소드

Check if specified 8 bpp image is grayscale.
The methods checks if the image is a grayscale image of 256 gradients. The method first examines if the image's pixel format is Format8bppIndexed and then it examines its palette to check if the image is grayscale or not.
public static IsGrayscale ( Bitmap image ) : bool
image System.Drawing.Bitmap Image to check.
리턴 bool

SetGrayscalePalette() 공개 정적인 메소드

Set pallete of the 8 bpp indexed image to grayscale.
The method initializes palette of Format8bppIndexed image with 256 gradients of gray color.
Provided image is not 8 bpp indexed image.
public static SetGrayscalePalette ( Bitmap image ) : void
image System.Drawing.Bitmap Image to initialize.
리턴 void