C# Class SFML.Graphics.Image

显示文件 Open project: SFML/SFML.Net Class Usage Examples

Public Methods

Method Description
Copy ( Image source, uint destX, uint destY ) : void

Copy pixels from another image onto this one. This function does a slow pixel copy and should only be used at initialization time

Copy ( Image source, uint destX, uint destY, IntRect sourceRect ) : void

Copy pixels from another image onto this one. This function does a slow pixel copy and should only be used at initialization time

Copy ( Image source, uint destX, uint destY, IntRect sourceRect, bool applyAlpha ) : void

Copy pixels from another image onto this one. This function does a slow pixel copy and should only be used at initialization time

CreateMaskFromColor ( System.Color color ) : void

Create a transparency mask from a specified colorkey

CreateMaskFromColor ( System.Color color, byte alpha ) : void

Create a transparency mask from a specified colorkey

FlipHorizontally ( ) : void

Flip the image horizontally

FlipVertically ( ) : void

Flip the image vertically

GetPixel ( uint x, uint y ) : System.Color

Get a pixel from the image

Image ( System.Color pixels ) : System

Construct the image directly from an array of pixels

Image ( Image copy ) : System

Construct the image from another image

Image ( System.Stream stream ) : System

Construct the image from a file in a stream

Image ( byte bytes ) : System

Construct the image from a file in memory

Image ( string filename ) : System

Construct the image from a file

Image ( uint width, uint height ) : System

Construct the image with black color

Image ( uint width, uint height, System.Color color ) : System

Construct the image from a single color

Image ( uint width, uint height, byte pixels ) : System

Construct the image directly from an array of pixels

SaveToFile ( string filename ) : bool

Save the contents of the image to a file

SetPixel ( uint x, uint y, System.Color color ) : void

Change the color of a pixel

ToString ( ) : string

Provide a string describing the object

Protected Methods

Method Description
Destroy ( bool disposing ) : void

Handle the destruction of the object

Private Methods

Method Description
Image ( IntPtr cPointer ) : System

Internal constructor

sfImage_copy ( IntPtr Image ) : IntPtr
sfImage_copyImage ( IntPtr CPointer, IntPtr Source, uint DestX, uint DestY, IntRect SourceRect, bool applyAlpha ) : void
sfImage_createFromColor ( uint Width, uint Height, System.Color Col ) : IntPtr
sfImage_createFromFile ( string Filename ) : IntPtr
sfImage_createFromMemory ( IntPtr data, ulong size ) : IntPtr
sfImage_createFromPixels ( uint Width, uint Height, byte Pixels ) : IntPtr
sfImage_createFromStream ( IntPtr stream ) : IntPtr
sfImage_createMaskFromColor ( IntPtr CPointer, System.Color Col, byte Alpha ) : void
sfImage_destroy ( IntPtr CPointer ) : void
sfImage_flipHorizontally ( IntPtr CPointer ) : uint
sfImage_flipVertically ( IntPtr CPointer ) : uint
sfImage_getPixel ( IntPtr CPointer, uint X, uint Y ) : System.Color
sfImage_getPixelsPtr ( IntPtr CPointer ) : IntPtr
sfImage_getSize ( IntPtr CPointer ) : Vector2u
sfImage_saveToFile ( IntPtr CPointer, string Filename ) : bool
sfImage_setPixel ( IntPtr CPointer, uint X, uint Y, System.Color Col ) : void

Method Details

Copy() public method

Copy pixels from another image onto this one. This function does a slow pixel copy and should only be used at initialization time
public Copy ( Image source, uint destX, uint destY ) : void
source Image Source image to copy
destX uint X coordinate of the destination position
destY uint Y coordinate of the destination position
return void

Copy() public method

Copy pixels from another image onto this one. This function does a slow pixel copy and should only be used at initialization time
public Copy ( Image source, uint destX, uint destY, IntRect sourceRect ) : void
source Image Source image to copy
destX uint X coordinate of the destination position
destY uint Y coordinate of the destination position
sourceRect IntRect Sub-rectangle of the source image to copy
return void

Copy() public method

Copy pixels from another image onto this one. This function does a slow pixel copy and should only be used at initialization time
public Copy ( Image source, uint destX, uint destY, IntRect sourceRect, bool applyAlpha ) : void
source Image Source image to copy
destX uint X coordinate of the destination position
destY uint Y coordinate of the destination position
sourceRect IntRect Sub-rectangle of the source image to copy
applyAlpha bool Should the copy take in account the source transparency?
return void

CreateMaskFromColor() public method

Create a transparency mask from a specified colorkey
public CreateMaskFromColor ( System.Color color ) : void
color System.Color Color to become transparent
return void

CreateMaskFromColor() public method

Create a transparency mask from a specified colorkey
public CreateMaskFromColor ( System.Color color, byte alpha ) : void
color System.Color Color to become transparent
alpha byte Alpha value to use for transparent pixels
return void

Destroy() protected method

Handle the destruction of the object
protected Destroy ( bool disposing ) : void
disposing bool Is the GC disposing the object, or is it an explicit call ?
return void

FlipHorizontally() public method

Flip the image horizontally
public FlipHorizontally ( ) : void
return void

FlipVertically() public method

Flip the image vertically
public FlipVertically ( ) : void
return void

GetPixel() public method

Get a pixel from the image
public GetPixel ( uint x, uint y ) : System.Color
x uint X coordinate of pixel in the image
y uint Y coordinate of pixel in the image
return System.Color

Image() public method

Construct the image directly from an array of pixels
public Image ( System.Color pixels ) : System
pixels System.Color 2 dimensions array containing the pixels
return System

Image() public method

Construct the image from another image
public Image ( Image copy ) : System
copy Image Image to copy
return System

Image() public method

Construct the image from a file in a stream
public Image ( System.Stream stream ) : System
stream System.Stream Stream containing the file contents
return System

Image() public method

Construct the image from a file in memory
public Image ( byte bytes ) : System
bytes byte Byte array containing the file contents
return System

Image() public method

Construct the image from a file
public Image ( string filename ) : System
filename string Path of the image file to load
return System

Image() public method

Construct the image with black color
public Image ( uint width, uint height ) : System
width uint Image width
height uint Image height
return System

Image() public method

Construct the image from a single color
public Image ( uint width, uint height, System.Color color ) : System
width uint Image width
height uint Image height
color System.Color Color to fill the image with
return System

Image() public method

Construct the image directly from an array of pixels
public Image ( uint width, uint height, byte pixels ) : System
width uint Image width
height uint Image height
pixels byte array containing the pixels
return System

SaveToFile() public method

Save the contents of the image to a file
public SaveToFile ( string filename ) : bool
filename string Path of the file to save (overwritten if already exist)
return bool

SetPixel() public method

Change the color of a pixel
public SetPixel ( uint x, uint y, System.Color color ) : void
x uint X coordinate of pixel in the image
y uint Y coordinate of pixel in the image
color System.Color New color for pixel (x, y)
return void

ToString() public method

Provide a string describing the object
public ToString ( ) : string
return string