C# Класс QualityBot.Util.ImageUtil

Показать файл Открыть проект

Открытые методы

Метод Описание
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