C# Class Utilities.Media.SwiftBitmap

Bitmap wrapper. Helps make Bitmap access faster and a bit simpler.
Inheritance: Utilities.DataTypes.Patterns.BaseClasses.SafeDisposableBaseClass, ICloneable
Show file Open project: JaCraig/Craig-s-Utility-Library Class Usage Examples

Private Properties

Property Type Description
GetImageFormat System.Drawing.Imaging.ImageFormat
GetPixelSize int

Public Methods

Method Description
ApplyColorMatrix ( System matrix ) : SwiftBitmap

Applies the matrix.

ApplyColorMatrix ( float matrix ) : SwiftBitmap

Applies the matrix.

ApplyConvolutionFilter ( int filter, bool absolute = false, int offset ) : SwiftBitmap

Applies the convolution filter to the image

Clone ( ) : object

Creates a new object that is a copy of the current instance.

Copy ( SwiftBitmap SwiftBitmap ) : SwiftBitmap

Copies the image from one image to this one.

Crop ( int Width, int Height, Align VAlignment, Align HAlignment ) : SwiftBitmap

Crops the image by the specified width/height

DrawPath ( Pen pen, GraphicsPath path ) : SwiftBitmap

Draws the path specified

DrawText ( string TextToDraw, Font FontToUse, Brush BrushUsing, RectangleF BoxToDrawWithin ) : SwiftBitmap

Draws the text specified

Fill ( Color color ) : SwiftBitmap

Fills the image with the specified color.

GetPixel ( int position ) : Color

Gets the pixel.

GetPixel ( int x, int y ) : Color

Gets the pixel.

Lock ( ) : SwiftBitmap

Locks this instance.

Resize ( int Width, int Height, Quality Quality = Quality.Low ) : SwiftBitmap

Resizes an SwiftBitmap to a certain height

Rotate ( RotateFlipType flipType ) : SwiftBitmap

Rotates and/or flips the image

Rotate ( float DegreesToRotate ) : SwiftBitmap

Rotates an image

Save ( string fileName ) : SwiftBitmap

Saves to the specified file name.

SetPixel ( int x, int y, Color pixelColor ) : SwiftBitmap

Sets the pixel.

SetPixels ( int x, int y, Color pixels ) : SwiftBitmap

Sets the pixels starting at the x and y coordinate specified.

SwiftBitmap ( Bitmap bitmap ) : System

Initializes a new instance of the SwiftBitmap class.

SwiftBitmap ( Image image ) : System

Initializes a new instance of the SwiftBitmap class.

SwiftBitmap ( Stream stream ) : System

Initializes a new instance of the SwiftBitmap class.

SwiftBitmap ( int width, int height ) : System

Initializes a new instance of the SwiftBitmap class.

SwiftBitmap ( string fileName ) : System

Initializes a new instance of the SwiftBitmap class.

ToString ( ImageFormat desiredFormat ) : string

Converts an SwiftBitmap to a base64 string and returns it

Unlock ( ) : SwiftBitmap

Unlocks this SwiftBitmap

operator ( ) : SwiftBitmap

Implements the operator &.

Protected Methods

Method Description
Dispose ( bool Managed ) : void

Function to override in order to dispose objects

Private Methods

Method Description
GetImageFormat ( string fileName ) : ImageFormat

Returns the SwiftBitmap format this file is using

GetPixelSize ( ) : int

Gets the size of the pixel.

Method Details

ApplyColorMatrix() public method

Applies the matrix.
public ApplyColorMatrix ( System matrix ) : SwiftBitmap
matrix System The matrix.
return SwiftBitmap

ApplyColorMatrix() public method

Applies the matrix.
public ApplyColorMatrix ( float matrix ) : SwiftBitmap
matrix float The matrix.
return SwiftBitmap

ApplyConvolutionFilter() public method

Applies the convolution filter to the image
public ApplyConvolutionFilter ( int filter, bool absolute = false, int offset ) : SwiftBitmap
filter int The filter.
absolute bool if set to true then the absolute value is used
offset int The offset to use for each pixel
return SwiftBitmap

Clone() public method

Creates a new object that is a copy of the current instance.
public Clone ( ) : object
return object

Copy() public method

Copies the image from one image to this one.
public Copy ( SwiftBitmap SwiftBitmap ) : SwiftBitmap
SwiftBitmap SwiftBitmap The SwiftBitmap to copy from.
return SwiftBitmap

Crop() public method

Crops the image by the specified width/height
public Crop ( int Width, int Height, Align VAlignment, Align HAlignment ) : SwiftBitmap
Width int The width.
Height int The height.
VAlignment Align The v alignment.
HAlignment Align The h alignment.
return SwiftBitmap

Dispose() protected method

Function to override in order to dispose objects
protected Dispose ( bool Managed ) : void
Managed bool /// If true, managed and unmanaged objects should be disposed. Otherwise unmanaged objects only. ///
return void

DrawPath() public method

Draws the path specified
public DrawPath ( Pen pen, GraphicsPath path ) : SwiftBitmap
pen System.Drawing.Pen The pen to use.
path System.Drawing.Drawing2D.GraphicsPath The path to draw
return SwiftBitmap

DrawText() public method

Draws the text specified
public DrawText ( string TextToDraw, Font FontToUse, Brush BrushUsing, RectangleF BoxToDrawWithin ) : SwiftBitmap
TextToDraw string The text to draw.
FontToUse System.Drawing.Font The font to use.
BrushUsing System.Drawing.Brush The brush to use.
BoxToDrawWithin System.Drawing.RectangleF The box to draw within.
return SwiftBitmap

Fill() public method

Fills the image with the specified color.
public Fill ( Color color ) : SwiftBitmap
color Color The color.
return SwiftBitmap

GetPixel() public method

Gets the pixel.
public GetPixel ( int position ) : Color
position int The position in the image
return Color

GetPixel() public method

Gets the pixel.
public GetPixel ( int x, int y ) : Color
x int The x position
y int The y position
return Color

Lock() public method

Locks this instance.
public Lock ( ) : SwiftBitmap
return SwiftBitmap

Resize() public method

Resizes an SwiftBitmap to a certain height
public Resize ( int Width, int Height, Quality Quality = Quality.Low ) : SwiftBitmap
Width int New width for the final image
Height int New height for the final image
Quality Quality Quality of the resizing
return SwiftBitmap

Rotate() public method

Rotates and/or flips the image
public Rotate ( RotateFlipType flipType ) : SwiftBitmap
flipType RotateFlipType Type of flip/rotation to do
return SwiftBitmap

Rotate() public method

Rotates an image
public Rotate ( float DegreesToRotate ) : SwiftBitmap
DegreesToRotate float Degrees to rotate the image
return SwiftBitmap

Save() public method

Saves to the specified file name.
public Save ( string fileName ) : SwiftBitmap
fileName string Name of the file.
return SwiftBitmap

SetPixel() public method

Sets the pixel.
public SetPixel ( int x, int y, Color pixelColor ) : SwiftBitmap
x int The x position
y int The y position
pixelColor Color Color of the pixel.
return SwiftBitmap

SetPixels() public method

Sets the pixels starting at the x and y coordinate specified.
public SetPixels ( int x, int y, Color pixels ) : SwiftBitmap
x int The beginning x coordinate
y int The beginning y coordinate
pixels Color The pixels to set
return SwiftBitmap

SwiftBitmap() public method

Initializes a new instance of the SwiftBitmap class.
public SwiftBitmap ( Bitmap bitmap ) : System
bitmap System.Drawing.Bitmap The bitmap.
return System

SwiftBitmap() public method

Initializes a new instance of the SwiftBitmap class.
public SwiftBitmap ( Image image ) : System
image Image The image.
return System

SwiftBitmap() public method

Initializes a new instance of the SwiftBitmap class.
public SwiftBitmap ( Stream stream ) : System
stream Stream The stream.
return System

SwiftBitmap() public method

Initializes a new instance of the SwiftBitmap class.
public SwiftBitmap ( int width, int height ) : System
width int The width.
height int The height.
return System

SwiftBitmap() public method

Initializes a new instance of the SwiftBitmap class.
public SwiftBitmap ( string fileName ) : System
fileName string Name of the file.
return System

ToString() public method

Converts an SwiftBitmap to a base64 string and returns it
public ToString ( ImageFormat desiredFormat ) : string
desiredFormat System.Drawing.Imaging.ImageFormat Desired SwiftBitmap format (defaults to Jpeg)
return string

Unlock() public method

Unlocks this SwiftBitmap
public Unlock ( ) : SwiftBitmap
return SwiftBitmap

operator() public static method

Implements the operator &.
public static operator ( ) : SwiftBitmap
return SwiftBitmap