C# Class Sphere.Core.Utility.FastBitmap

Used to efficiently and quickly manipulate bitmaps.
Afficher le fichier Open project: Radnen/spherestudio

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

Clone() public méthode

Creates a clone of the wrapped image object.
public Clone ( ) : Bitmap
Résultat System.Drawing.Bitmap

Clone() public méthode

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.
Résultat System.Drawing.Bitmap

Clone() public méthode

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.
Résultat System.Drawing.Bitmap

ColorsEqual() public static méthode

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.
Résultat bool

DrawImage() public méthode

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.
Résultat void

FastBitmap() public méthode

Creates a FastBitmap wrapper for an image object.
public FastBitmap ( Bitmap img ) : System
img System.Drawing.Bitmap The image object to wrap.
Résultat System

FlattenAlpha() public méthode

Sets all transparency to max value.
public FlattenAlpha ( ) : void
Résultat void

FloodFill() public méthode

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
Résultat System.Drawing.Rectangle

GetPixel() public méthode

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.
Résultat Color

Grayscale() public méthode

Converts the image to a grayscale representation.
public Grayscale ( ) : void
Résultat void

LockImage() public méthode

Locks the image to get it ready for fast manipluations.
public LockImage ( ) : void
Résultat void

ReplaceColor() public méthode

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.
Résultat void

SetPixel() public méthode

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.
Résultat void

UnlockImage() public méthode

Unlocks the image.
public UnlockImage ( ) : void
Résultat void