Craig's Utility Library  4.0 Beta
Utilities.Media.SwiftBitmap Class Reference

Bitmap wrapper. Helps make Bitmap access faster and a bit simpler. More...

Inheritance diagram for Utilities.Media.SwiftBitmap:
Utilities.DataTypes.Patterns.BaseClasses.SafeDisposableBaseClass

Public Member Functions

 SwiftBitmap (string fileName)
 Initializes a new instance of the SwiftBitmap class. More...
 
 SwiftBitmap (int width, int height)
 Initializes a new instance of the SwiftBitmap class. More...
 
 SwiftBitmap (Stream stream)
 Initializes a new instance of the SwiftBitmap class. More...
 
 SwiftBitmap (Image image)
 Initializes a new instance of the SwiftBitmap class. More...
 
 SwiftBitmap (Bitmap bitmap)
 Initializes a new instance of the SwiftBitmap class. More...
 
SwiftBitmap ApplyColorMatrix (System.Drawing.Imaging.ColorMatrix matrix)
 Applies the matrix. More...
 
SwiftBitmap ApplyColorMatrix (float[][] matrix)
 Applies the matrix. More...
 
SwiftBitmap ApplyConvolutionFilter (int[][] filter, bool absolute=false, int offset=0)
 Applies the convolution filter to the image More...
 
object Clone ()
 Creates a new object that is a copy of the current instance. More...
 
unsafe SwiftBitmap Copy (SwiftBitmap SwiftBitmap)
 Copies the image from one image to this one. More...
 
SwiftBitmap Crop (int Width, int Height, Align VAlignment, Align HAlignment)
 Crops the image by the specified width/height More...
 
SwiftBitmap DrawPath (Pen pen, GraphicsPath path)
 Draws the path specified More...
 
SwiftBitmap DrawText (string TextToDraw, Font FontToUse, Brush BrushUsing, RectangleF BoxToDrawWithin)
 Draws the text specified More...
 
SwiftBitmap Fill (Color color)
 Fills the image with the specified color. More...
 
unsafe Color GetPixel (int x, int y)
 Gets the pixel. More...
 
unsafe Color GetPixel (int position)
 Gets the pixel. More...
 
unsafe SwiftBitmap Lock ()
 Locks this instance. More...
 
SwiftBitmap Resize (int Width, int Height, Quality Quality=Quality.Low)
 Resizes an SwiftBitmap to a certain height More...
 
SwiftBitmap Rotate (RotateFlipType flipType)
 Rotates and/or flips the image More...
 
SwiftBitmap Rotate (float DegreesToRotate)
 Rotates an image More...
 
SwiftBitmap Save (string fileName)
 Saves to the specified file name. More...
 
unsafe SwiftBitmap SetPixel (int x, int y, Color pixelColor)
 Sets the pixel. More...
 
unsafe SwiftBitmap SetPixels (int x, int y, Color[] pixels)
 Sets the pixels starting at the x and y coordinate specified. More...
 
string ToString (ImageFormat desiredFormat)
 Converts an SwiftBitmap to a base64 string and returns it More...
 
unsafe SwiftBitmap Unlock ()
 Unlocks this SwiftBitmap More...
 
- Public Member Functions inherited from Utilities.DataTypes.Patterns.BaseClasses.SafeDisposableBaseClass
void Dispose ()
 Dispose function More...
 

Static Public Member Functions

static SwiftBitmap operator& (SwiftBitmap Image1, SwiftBitmap Image2)
 Implements the operator &. More...
 
static SwiftBitmap operator^ (SwiftBitmap Image1, SwiftBitmap Image2)
 Implements the operator ^. More...
 
static SwiftBitmap operator| (SwiftBitmap Image1, SwiftBitmap Image2)
 Implements the operator |. More...
 

Protected Member Functions

override void Dispose (bool Managed)
 Function to override in order to dispose objects More...
 
- Protected Member Functions inherited from Utilities.DataTypes.Patterns.BaseClasses.SafeDisposableBaseClass
 SafeDisposableBaseClass ()
 Construct More...
 

Properties

int Height [get]
 Gets or sets the height. More...
 
IEnumerable< string > HTMLPalette [get]
 Gets a palette listing in HTML string format More...
 
Bitmap InternalBitmap [get]
 Gets the internal Bitmap. More...
 
int Width [get]
 Gets or sets the width. More...
 
BitmapData Data [get]
 Gets the data. More...
 
unsafe byte * DataPointer [get]
 Gets the data pointer. More...
 
int PixelSize [get]
 Gets the pixel size (in bytes) More...
 

Detailed Description

Bitmap wrapper. Helps make Bitmap access faster and a bit simpler.

Definition at line 40 of file SwiftBitmap.cs.

Constructor & Destructor Documentation

Utilities.Media.SwiftBitmap.SwiftBitmap ( string  fileName)

Initializes a new instance of the SwiftBitmap class.

Parameters
fileNameName of the file.

Definition at line 46 of file SwiftBitmap.cs.

Utilities.Media.SwiftBitmap.SwiftBitmap ( int  width,
int  height 
)

Initializes a new instance of the SwiftBitmap class.

Parameters
widthThe width.
heightThe height.

Definition at line 57 of file SwiftBitmap.cs.

Utilities.Media.SwiftBitmap.SwiftBitmap ( Stream  stream)

Initializes a new instance of the SwiftBitmap class.

Parameters
streamThe stream.

Definition at line 66 of file SwiftBitmap.cs.

Utilities.Media.SwiftBitmap.SwiftBitmap ( Image  image)

Initializes a new instance of the SwiftBitmap class.

Parameters
imageThe image.

Definition at line 76 of file SwiftBitmap.cs.

Utilities.Media.SwiftBitmap.SwiftBitmap ( Bitmap  bitmap)

Initializes a new instance of the SwiftBitmap class.

Parameters
bitmapThe bitmap.

Definition at line 86 of file SwiftBitmap.cs.

Member Function Documentation

SwiftBitmap Utilities.Media.SwiftBitmap.ApplyColorMatrix ( System.Drawing.Imaging.ColorMatrix  matrix)

Applies the matrix.

Parameters
matrixThe matrix.
Returns
This

Definition at line 263 of file SwiftBitmap.cs.

SwiftBitmap Utilities.Media.SwiftBitmap.ApplyColorMatrix ( float  matrix[][])

Applies the matrix.

Parameters
matrixThe matrix.
Returns
This

Definition at line 288 of file SwiftBitmap.cs.

SwiftBitmap Utilities.Media.SwiftBitmap.ApplyConvolutionFilter ( int  filter[][],
bool  absolute = false,
int  offset = 0 
)

Applies the convolution filter to the image

Parameters
filterThe filter.
absoluteif set to true then the absolute value is used
offsetThe offset to use for each pixel
Returns
Returns the image with the filter applied

Definition at line 302 of file SwiftBitmap.cs.

object Utilities.Media.SwiftBitmap.Clone ( )

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

Returns
A new object that is a copy of this instance.

Definition at line 370 of file SwiftBitmap.cs.

unsafe SwiftBitmap Utilities.Media.SwiftBitmap.Copy ( SwiftBitmap  SwiftBitmap)

Copies the image from one image to this one.

Parameters
SwiftBitmapThe SwiftBitmap to copy from.
Returns
This

Definition at line 381 of file SwiftBitmap.cs.

SwiftBitmap Utilities.Media.SwiftBitmap.Crop ( int  Width,
int  Height,
Align  VAlignment,
Align  HAlignment 
)

Crops the image by the specified width/height

Parameters
WidthThe width.
HeightThe height.
VAlignmentThe v alignment.
HAlignmentThe h alignment.
Returns

Definition at line 400 of file SwiftBitmap.cs.

override void Utilities.Media.SwiftBitmap.Dispose ( bool  Managed)
protectedvirtual

Function to override in order to dispose objects

Parameters
ManagedIf true, managed and unmanaged objects should be disposed. Otherwise unmanaged objects only.

Implements Utilities.DataTypes.Patterns.BaseClasses.SafeDisposableBaseClass.

Definition at line 702 of file SwiftBitmap.cs.

SwiftBitmap Utilities.Media.SwiftBitmap.DrawPath ( Pen  pen,
GraphicsPath  path 
)

Draws the path specified

Parameters
penThe pen to use.
pathThe path to draw
Returns
This

Definition at line 427 of file SwiftBitmap.cs.

SwiftBitmap Utilities.Media.SwiftBitmap.DrawText ( string  TextToDraw,
Font  FontToUse,
Brush  BrushUsing,
RectangleF  BoxToDrawWithin 
)

Draws the text specified

Parameters
TextToDrawThe text to draw.
FontToUseThe font to use.
BrushUsingThe brush to use.
BoxToDrawWithinThe box to draw within.
Returns
This

Definition at line 448 of file SwiftBitmap.cs.

SwiftBitmap Utilities.Media.SwiftBitmap.Fill ( Color  color)

Fills the image with the specified color.

Parameters
colorThe color.
Returns
This

Definition at line 467 of file SwiftBitmap.cs.

unsafe Color Utilities.Media.SwiftBitmap.GetPixel ( int  x,
int  y 
)

Gets the pixel.

Parameters
xThe x position
yThe y position
Returns
This

Definition at line 480 of file SwiftBitmap.cs.

unsafe Color Utilities.Media.SwiftBitmap.GetPixel ( int  position)

Gets the pixel.

Parameters
positionThe position in the image
Returns
This

Definition at line 494 of file SwiftBitmap.cs.

unsafe SwiftBitmap Utilities.Media.SwiftBitmap.Lock ( )

Locks this instance.

Returns
This

Definition at line 507 of file SwiftBitmap.cs.

static SwiftBitmap Utilities.Media.SwiftBitmap.operator& ( SwiftBitmap  Image1,
SwiftBitmap  Image2 
)
static

Implements the operator &.

Parameters
Image1The first image.
Image2The second image
Returns
The result of the operator.

Definition at line 171 of file SwiftBitmap.cs.

static SwiftBitmap Utilities.Media.SwiftBitmap.operator^ ( SwiftBitmap  Image1,
SwiftBitmap  Image2 
)
static

Implements the operator ^.

Parameters
Image1The first image.
Image2The second image
Returns
The result of the operator.

Definition at line 202 of file SwiftBitmap.cs.

static SwiftBitmap Utilities.Media.SwiftBitmap.operator| ( SwiftBitmap  Image1,
SwiftBitmap  Image2 
)
static

Implements the operator |.

Parameters
Image1The first image.
Image2The second image
Returns
The result of the operator.

Definition at line 233 of file SwiftBitmap.cs.

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

Resizes an SwiftBitmap to a certain height

Parameters
WidthNew width for the final image
HeightNew height for the final image
QualityQuality of the resizing
Returns
This

Definition at line 527 of file SwiftBitmap.cs.

SwiftBitmap Utilities.Media.SwiftBitmap.Rotate ( RotateFlipType  flipType)

Rotates and/or flips the image

Parameters
flipTypeType of flip/rotation to do
Returns
This

Definition at line 560 of file SwiftBitmap.cs.

SwiftBitmap Utilities.Media.SwiftBitmap.Rotate ( float  DegreesToRotate)

Rotates an image

Parameters
DegreesToRotateDegrees to rotate the image
Returns
This

Definition at line 573 of file SwiftBitmap.cs.

SwiftBitmap Utilities.Media.SwiftBitmap.Save ( string  fileName)

Saves to the specified file name.

Parameters
fileNameName of the file.
Returns
This

Definition at line 598 of file SwiftBitmap.cs.

unsafe SwiftBitmap Utilities.Media.SwiftBitmap.SetPixel ( int  x,
int  y,
Color  pixelColor 
)

Sets the pixel.

Parameters
xThe x position
yThe y position
pixelColorColor of the pixel.
Returns
This

Definition at line 614 of file SwiftBitmap.cs.

unsafe SwiftBitmap Utilities.Media.SwiftBitmap.SetPixels ( int  x,
int  y,
Color[]  pixels 
)

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

Parameters
xThe beginning x coordinate
yThe beginning y coordinate
pixelsThe pixels to set
Returns
This

Definition at line 639 of file SwiftBitmap.cs.

string Utilities.Media.SwiftBitmap.ToString ( ImageFormat  desiredFormat)

Converts an SwiftBitmap to a base64 string and returns it

Parameters
desiredFormatDesired SwiftBitmap format (defaults to Jpeg)
Returns
The SwiftBitmap in base64 string format

Definition at line 670 of file SwiftBitmap.cs.

unsafe SwiftBitmap Utilities.Media.SwiftBitmap.Unlock ( )

Unlocks this SwiftBitmap

Returns
This

Definition at line 685 of file SwiftBitmap.cs.

Property Documentation

BitmapData Utilities.Media.SwiftBitmap.Data
getprotected

Gets the data.

The data.

Definition at line 148 of file SwiftBitmap.cs.

unsafe byte* Utilities.Media.SwiftBitmap.DataPointer
getprotected

Gets the data pointer.

The data pointer.

Definition at line 155 of file SwiftBitmap.cs.

int Utilities.Media.SwiftBitmap.Height
get

Gets or sets the height.

The height.

Definition at line 98 of file SwiftBitmap.cs.

IEnumerable<string> Utilities.Media.SwiftBitmap.HTMLPalette
get

Gets a palette listing in HTML string format

A list containing HTML color values (ex: #041845)

Definition at line 105 of file SwiftBitmap.cs.

Bitmap Utilities.Media.SwiftBitmap.InternalBitmap
get

Gets the internal Bitmap.

The internal Bitmap.

Definition at line 136 of file SwiftBitmap.cs.

int Utilities.Media.SwiftBitmap.PixelSize
getprotected

Gets the pixel size (in bytes)

The size of the pixel.

Definition at line 161 of file SwiftBitmap.cs.

int Utilities.Media.SwiftBitmap.Width
get

Gets or sets the width.

The width.

Definition at line 142 of file SwiftBitmap.cs.


The documentation for this class was generated from the following file: