C# 클래스 QualityBot.Util.ImageUtil

파일 보기 프로젝트 열기: Ancestry/quality-bot

공개 메소드들

메소드 설명
Base64ToBytes ( string base64 ) : byte[]

Converts a base 64 encoded string to a byte array.

Base64ToImage ( string base64 ) : Image

Converts a base 64 encoded string to an image.

BitmapDiff ( Bitmap bitmapA, Bitmap bitmapB, ImageAttributes ia, decimal &percentageDifferent ) : Bitmap

Compares two bitmaps pixel-by-pixel and returns a bitmap mask of the difference.

BytesToBase64 ( byte bytes ) : string

Converts a byte array to a base 64 encoded string.

BytesToImage ( byte imageBytes ) : Image

Converts a byte array to an image.

CropImage ( Image image, Rectangle cropArea ) : Image

Crops the image to the specified rectangle.

DrawRegionAsMasks ( Size size, Region region, Image image, ImageAttributes ia ) : Bitmap

Draws the region as green, and the inverted region as red.

GetClippedImage ( Size size, Image image, Region region ) : Bitmap

Clips an image to the specified region.

GetClippedRegion ( Rectangle rectangle, IEnumerable potentialIntersections ) : Region

Calculates the region of the rectangle that is not overlapped by siblings or children.

ImageToBase64 ( Image image, ImageFormat format ) : string

Converts an image to a base 64 encoded string.

ImageToBytes ( Image image, ImageFormat format ) : byte[]

Converts an image to a byte array.

IsColorMatch ( Color color1, Color color2 ) : bool

Determines if two colors are equivalent.

SaveImageToDisc ( string outputDir, string base64Image, string imageSuffix ) : string

Saves the specified image to disc.

메소드 상세

Base64ToBytes() 공개 정적인 메소드

Converts a base 64 encoded string to a byte array.
public static Base64ToBytes ( string base64 ) : byte[]
base64 string The base 64 encoded image.
리턴 byte[]

Base64ToImage() 공개 정적인 메소드

Converts a base 64 encoded string to an image.
public static Base64ToImage ( string base64 ) : Image
base64 string The base 64 encoded image.
리턴 Image

BitmapDiff() 공개 정적인 메소드

Compares two bitmaps pixel-by-pixel and returns a bitmap mask of the difference.
public static BitmapDiff ( Bitmap bitmapA, Bitmap bitmapB, ImageAttributes ia, decimal &percentageDifferent ) : Bitmap
bitmapA System.Drawing.Bitmap The first bitmap.
bitmapB System.Drawing.Bitmap The second bitmap.
ia System.Drawing.Imaging.ImageAttributes The image attributes.
percentageDifferent decimal The difference between the two images as a percentage.
리턴 System.Drawing.Bitmap

BytesToBase64() 공개 정적인 메소드

Converts a byte array to a base 64 encoded string.
public static BytesToBase64 ( byte bytes ) : string
bytes byte The byte array.
리턴 string

BytesToImage() 공개 정적인 메소드

Converts a byte array to an image.
public static BytesToImage ( byte imageBytes ) : Image
imageBytes byte The byte array.
리턴 Image

CropImage() 공개 정적인 메소드

Crops the image to the specified rectangle.
public static CropImage ( Image image, Rectangle cropArea ) : Image
image Image The image.
cropArea System.Drawing.Rectangle The cropping rectangle.
리턴 Image

DrawRegionAsMasks() 공개 정적인 메소드

Draws the region as green, and the inverted region as red.
public static DrawRegionAsMasks ( Size size, Region region, Image image, ImageAttributes ia ) : Bitmap
size System.Drawing.Size The size of the image.
region System.Drawing.Region The clipping region.
image Image The image.
ia System.Drawing.Imaging.ImageAttributes The iamge attributes (such as alpha blending) to use when drawing the masks.
리턴 System.Drawing.Bitmap

GetClippedImage() 공개 정적인 메소드

Clips an image to the specified region.
public static GetClippedImage ( Size size, Image image, Region region ) : Bitmap
size System.Drawing.Size The size of the image.
image Image The image.
region System.Drawing.Region The region to clip.
리턴 System.Drawing.Bitmap

GetClippedRegion() 공개 정적인 메소드

Calculates the region of the rectangle that is not overlapped by siblings or children.
public static GetClippedRegion ( Rectangle rectangle, IEnumerable potentialIntersections ) : Region
rectangle System.Drawing.Rectangle The rectangle.
potentialIntersections IEnumerable An array of potentially intersecting rectangles.
리턴 System.Drawing.Region

ImageToBase64() 공개 정적인 메소드

Converts an image to a base 64 encoded string.
public static ImageToBase64 ( Image image, ImageFormat format ) : string
image Image The image.
format System.Drawing.Imaging.ImageFormat The image format.
리턴 string

ImageToBytes() 공개 정적인 메소드

Converts an image to a byte array.
public static ImageToBytes ( Image image, ImageFormat format ) : byte[]
image Image The image.
format System.Drawing.Imaging.ImageFormat The image format.
리턴 byte[]

IsColorMatch() 공개 정적인 메소드

Determines if two colors are equivalent.
public static IsColorMatch ( Color color1, Color color2 ) : bool
color1 Color The first color.
color2 Color The second color.
리턴 bool

SaveImageToDisc() 공개 정적인 메소드

Saves the specified image to disc.
public static SaveImageToDisc ( string outputDir, string base64Image, string imageSuffix ) : string
outputDir string The target directory.
base64Image string The image as a base64 encoded string.
imageSuffix string The filename suffix.
리턴 string