C# Класс Sphere.Core.Utility.FastBitmap

Used to efficiently and quickly manipulate bitmaps.
Показать файл Открыть проект

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

Метод Описание
Clone ( ) : Bitmap

Creates a clone of the wrapped image object.

Clone ( Rectangle rect, PixelFormat format ) : Bitmap

Grabs a sub-section clone of the wrapped image.

Clone ( RectangleF rect, PixelFormat format ) : Bitmap

Grabs a sub-section clone of the wrapped image.

ColorsEqual ( Color col1, Color col2 ) : bool

Determines if two colors equal.

DrawImage ( Bitmap img, int x, int y ) : void

Draws another bitmap into this image using straight-up pixel data. Not as fast as the Graphics.DrawImage();

FastBitmap ( Bitmap img ) : System

Creates a FastBitmap wrapper for an image object.

FlattenAlpha ( ) : void

Sets all transparency to max value.

FloodFill ( int x, int y, Color newColor ) : Rectangle

Replaces the colors of a particular area:

GetPixel ( int x, int y ) : Color

Gets a pixel at the x/y location.

Grayscale ( ) : void

Converts the image to a grayscale representation.

LockImage ( ) : void

Locks the image to get it ready for fast manipluations.

ReplaceColor ( Color oldC, Color newC ) : void

Replaces an old color with a new color.

SetPixel ( int x, int y, Color color ) : void

Sets a pixel at the x/y location to the new color.

UnlockImage ( ) : void

Unlocks the image.

Приватные методы

Метод Описание
CheckFloodPoint ( Stack points, int x, int y, Color oldC, Color newC ) : void
SetAlpha ( int x, int y, byte alpha ) : void
ToGray ( int x, int y ) : void

Описание методов

Clone() публичный Метод

Creates a clone of the wrapped image object.
public Clone ( ) : Bitmap
Результат System.Drawing.Bitmap

Clone() публичный Метод

Grabs a sub-section clone of the wrapped image.
public Clone ( Rectangle rect, PixelFormat format ) : Bitmap
rect System.Drawing.Rectangle The rectangle to cut from.
format PixelFormat The PixelFomat to use.
Результат System.Drawing.Bitmap

Clone() публичный Метод

Grabs a sub-section clone of the wrapped image.
public Clone ( RectangleF rect, PixelFormat format ) : Bitmap
rect System.Drawing.RectangleF The rectangle to cut from.
format PixelFormat The PixelFomat to use.
Результат System.Drawing.Bitmap

ColorsEqual() публичный статический Метод

Determines if two colors equal.
public static ColorsEqual ( Color col1, Color col2 ) : bool
col1 Color The color to compare.
col2 Color The color to compare against.
Результат bool

DrawImage() публичный Метод

Draws another bitmap into this image using straight-up pixel data. Not as fast as the Graphics.DrawImage();
public DrawImage ( Bitmap img, int x, int y ) : void
img System.Drawing.Bitmap The source image.
x int x location in pixels.
y int y location in pixels.
Результат void

FastBitmap() публичный Метод

Creates a FastBitmap wrapper for an image object.
public FastBitmap ( Bitmap img ) : System
img System.Drawing.Bitmap The image object to wrap.
Результат System

FlattenAlpha() публичный Метод

Sets all transparency to max value.
public FlattenAlpha ( ) : void
Результат void

FloodFill() публичный Метод

Replaces the colors of a particular area:
public FloodFill ( int x, int y, Color newColor ) : Rectangle
x int start x
y int start y
newColor Color color to replace with
Результат System.Drawing.Rectangle

GetPixel() публичный Метод

Gets a pixel at the x/y location.
Invalid color format.
public GetPixel ( int x, int y ) : Color
x int The x pixel location.
y int The y pixel location.
Результат Color

Grayscale() публичный Метод

Converts the image to a grayscale representation.
public Grayscale ( ) : void
Результат void

LockImage() публичный Метод

Locks the image to get it ready for fast manipluations.
public LockImage ( ) : void
Результат void

ReplaceColor() публичный Метод

Replaces an old color with a new color.
public ReplaceColor ( Color oldC, Color newC ) : void
oldC Color The color in the image to edit.
newC Color The color to replace with.
Результат void

SetPixel() публичный Метод

Sets a pixel at the x/y location to the new color.
public SetPixel ( int x, int y, Color color ) : void
x int The x pixel location.
y int The y pixel location.
color Color The color to set the pixel to.
Результат void

UnlockImage() публичный Метод

Unlocks the image.
public UnlockImage ( ) : void
Результат void