C# 클래스 Duality.ExtMethodsBitmap

Provides extension methods for Bitmaps.
파일 보기 프로젝트 열기: BraveSirAndrew/duality

공개 메소드들

메소드 설명
Crop ( this bm, bool cropX = true, bool cropY = true ) : Bitmap

Creates a cropped version of the specified Bitmap, removing transparent / empty border areas.

GetAverageColor ( this bm, bool weightTransparent = true ) : ColorRgba

Determines the average color of a Bitmap.

GetPixelDataIntArgb ( this bm ) : int[]

Extracts a Bitmaps pixel data as (signed) IntArgb values.

GetPixelDataRgba ( this bm ) : ColorRgba[]

Extracts a Bitmaps pixel data.

OpaqueBounds ( this bm ) : Rectangle

Measures the bounding rectangle of the opaque pixels in a Bitmap.

Rescale ( this bm, int w, int h, InterpolationMode mode = InterpolationMode.Bilinear ) : Bitmap

Creates a rescaled version of a Bitmap.

Resize ( this bm, int w, int h, Alignment origin = Alignment.TopLeft ) : Bitmap

Creates a resized version of a Bitmap. Gained space will be empty, lost space will crop the image.

SetPixelDataIntArgb ( this bm, int pixelData ) : void

Replaces a Bitmaps pixel data.

SetPixelDataRgba ( this bm, ColorRgba pixelData ) : void

Replaces a Bitmaps pixel data.

SetPixelDataRgba ( this bm, byte pixelData ) : void

Replaces a Bitmaps pixel data.

SubImage ( this bm, System.Drawing.Rect rect ) : Bitmap

Extracts a rectangular portion of the original image.

SubImage ( this bm, Rectangle rect ) : Bitmap

Extracts a rectangular portion of the original image.

SubImage ( this bm, int x, int y, int w, int h ) : Bitmap

Extracts a rectangular portion of the original image.

메소드 상세

Crop() 공개 정적인 메소드

Creates a cropped version of the specified Bitmap, removing transparent / empty border areas.
public static Crop ( this bm, bool cropX = true, bool cropY = true ) : Bitmap
bm this The original Bitmap.
cropX bool Whether the image should be cropped in X-direction
cropY bool Whether the image should be cropped in Y-direction
리턴 System.Drawing.Bitmap

GetAverageColor() 공개 정적인 메소드

Determines the average color of a Bitmap.
public static GetAverageColor ( this bm, bool weightTransparent = true ) : ColorRgba
bm this
weightTransparent bool If true, the alpha value weights a pixels color value.
리턴 ColorRgba

GetPixelDataIntArgb() 공개 정적인 메소드

Extracts a Bitmaps pixel data as (signed) IntArgb values.
public static GetPixelDataIntArgb ( this bm ) : int[]
bm this
리턴 int[]

GetPixelDataRgba() 공개 정적인 메소드

Extracts a Bitmaps pixel data.
public static GetPixelDataRgba ( this bm ) : ColorRgba[]
bm this
리턴 ColorRgba[]

OpaqueBounds() 공개 정적인 메소드

Measures the bounding rectangle of the opaque pixels in a Bitmap.
public static OpaqueBounds ( this bm ) : Rectangle
bm this
리턴 System.Drawing.Rectangle

Rescale() 공개 정적인 메소드

Creates a rescaled version of a Bitmap.
public static Rescale ( this bm, int w, int h, InterpolationMode mode = InterpolationMode.Bilinear ) : Bitmap
bm this The original Bitmap.
w int The desired width.
h int The desired height.
mode InterpolationMode Specified how to interpolate the original image in order to calculate the result image.
리턴 System.Drawing.Bitmap

Resize() 공개 정적인 메소드

Creates a resized version of a Bitmap. Gained space will be empty, lost space will crop the image.
public static Resize ( this bm, int w, int h, Alignment origin = Alignment.TopLeft ) : Bitmap
bm this The original Bitmap.
w int The desired width.
h int The desired height.
origin Alignment The desired resize origin in the original image.
리턴 System.Drawing.Bitmap

SetPixelDataIntArgb() 공개 정적인 메소드

Replaces a Bitmaps pixel data.
public static SetPixelDataIntArgb ( this bm, int pixelData ) : void
bm this
pixelData int
리턴 void

SetPixelDataRgba() 공개 정적인 메소드

Replaces a Bitmaps pixel data.
public static SetPixelDataRgba ( this bm, ColorRgba pixelData ) : void
bm this
pixelData ColorRgba
리턴 void

SetPixelDataRgba() 공개 정적인 메소드

Replaces a Bitmaps pixel data.
public static SetPixelDataRgba ( this bm, byte pixelData ) : void
bm this
pixelData byte
리턴 void

SubImage() 공개 정적인 메소드

Extracts a rectangular portion of the original image.
public static SubImage ( this bm, System.Drawing.Rect rect ) : Bitmap
bm this The original Bitmap.
rect System.Drawing.Rect The rectangular portion to extract.
리턴 System.Drawing.Bitmap

SubImage() 공개 정적인 메소드

Extracts a rectangular portion of the original image.
public static SubImage ( this bm, Rectangle rect ) : Bitmap
bm this The original Bitmap.
rect System.Drawing.Rectangle The rectangular portion to extract.
리턴 System.Drawing.Bitmap

SubImage() 공개 정적인 메소드

Extracts a rectangular portion of the original image.
public static SubImage ( this bm, int x, int y, int w, int h ) : Bitmap
bm this The original Bitmap.
x int The rectangular portion to extract.
y int The rectangular portion to extract.
w int The rectangular portion to extract.
h int The rectangular portion to extract.
리턴 System.Drawing.Bitmap