ScottPlot
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
ScottPlot.Image Class Reference

Bitmap representation of an image with helper methods for manipulating the image and enabling IO with other platforms. More...

Inheritance diagram for ScottPlot.Image:
IDisposable

Public Member Functions

 Image (SKSurface surface)
 Create an Image from the snapshot of an existing Surface.
 
 Image (string filename)
 Create an Image from a file on disk.
 
 Image (byte[] bytes)
 Create an Image from a byte array of image data encoded in a common file format.
 
 Image (SKBitmap bmp)
 Create an Image from an existing bitmap.
 
 Image (int width, int height)
 Create a black Image with the given dimensions.
 
 Image (PixelSize size)
 Create a black Image with the given dimensions.
 
 Image (int width, int height, Color color)
 Create an image filled with the given color.
 
 Image (byte[,] pixelArray)
 Create a grayscale Image from a 2D array of bytes. R, G, and B channels will all be set to the given value for each pixel.
 
 Image (byte[,,] pixelArray)
 Create an Image from a 3D array of bytes with axes representing Y position, X position, and Color.
 
byte[] GetImageBytes (ImageFormat format=ImageFormat.Png, int quality=100)
 Return the image as a platform-agnostic byte array that can be consumed by any common image library.
 
SavedImageInfo SaveJpeg (string path, int quality=85)
 
SavedImageInfo SavePng (string path)
 
SavedImageInfo SaveBmp (string path)
 
SavedImageInfo SaveWebp (string path, int quality=85)
 
SavedImageInfo Save (string path, ImageFormat format=ImageFormat.Png, int quality=85)
 
void Dispose ()
 
void Render (SKCanvas canvas, PixelRect target, SKPaint paint, bool antiAlias)
 Draw the image onto the given canvas.
 
byte[,] GetArrayGrayscale ()
 Return the image as a 2D byte array grayscale image with axes representing X and Y positions. Grayscale values for each pixel are the mean of R, G, and B channels.
 
byte[,,] GetArrayRGB ()
 Return the image as a 3D byte array with axes representing X position, Y position, and Color.
 
Image GetAutoscaledImage ()
 Return a new image with brightness/contrast maximized to fit the range of the data.
 
Image Scaled (double scale, bool antiAlias=true)
 Return a new image with dimensions scaled by the given scale factor. A scale factor of 2.0 will double the size of the returned image.
 
Image Scaled (double scaleX, double scaleY, bool antiAlias=true)
 Return a new image with dimensions scaled by the given scale factors. A scale factor of 2.0 will double the size of the returned image.
 
Image Resized (int newWidth, int newHeight, bool antiAlias=true)
 Return a new image resized to fit the given dimensions.
 

Properties

SKImage SKImage [get]
 
int Width [get]
 
int Height [get]
 
PixelSize Size [get]
 

Detailed Description

Bitmap representation of an image with helper methods for manipulating the image and enabling IO with other platforms.

Constructor & Destructor Documentation

◆ Image() [1/9]

ScottPlot.Image.Image ( SKSurface  surface)
inline

Create an Image from the snapshot of an existing Surface.

◆ Image() [2/9]

ScottPlot.Image.Image ( string  filename)
inline

Create an Image from a file on disk.

◆ Image() [3/9]

ScottPlot.Image.Image ( byte[]  bytes)
inline

Create an Image from a byte array of image data encoded in a common file format.

◆ Image() [4/9]

ScottPlot.Image.Image ( SKBitmap  bmp)
inline

Create an Image from an existing bitmap.

◆ Image() [5/9]

ScottPlot.Image.Image ( int  width,
int  height 
)
inline

Create a black Image with the given dimensions.

◆ Image() [6/9]

ScottPlot.Image.Image ( PixelSize  size)
inline

Create a black Image with the given dimensions.

◆ Image() [7/9]

ScottPlot.Image.Image ( int  width,
int  height,
Color  color 
)
inline

Create an image filled with the given color.

◆ Image() [8/9]

ScottPlot.Image.Image ( byte  pixelArray[,])
inline

Create a grayscale Image from a 2D array of bytes. R, G, and B channels will all be set to the given value for each pixel.

◆ Image() [9/9]

ScottPlot.Image.Image ( byte  pixelArray[,,])
inline

Create an Image from a 3D array of bytes with axes representing Y position, X position, and Color.

Member Function Documentation

◆ Dispose()

void ScottPlot.Image.Dispose ( )
inline

◆ GetArrayGrayscale()

byte[,] ScottPlot.Image.GetArrayGrayscale ( )
inline

Return the image as a 2D byte array grayscale image with axes representing X and Y positions. Grayscale values for each pixel are the mean of R, G, and B channels.

◆ GetArrayRGB()

byte[,,] ScottPlot.Image.GetArrayRGB ( )
inline

Return the image as a 3D byte array with axes representing X position, Y position, and Color.

◆ GetAutoscaledImage()

Image ScottPlot.Image.GetAutoscaledImage ( )
inline

Return a new image with brightness/contrast maximized to fit the range of the data.

◆ GetImageBytes()

byte[] ScottPlot.Image.GetImageBytes ( ImageFormat  format = ImageFormat::Png,
int  quality = 100 
)
inline

Return the image as a platform-agnostic byte array that can be consumed by any common image library.

◆ Render()

void ScottPlot.Image.Render ( SKCanvas  canvas,
PixelRect  target,
SKPaint  paint,
bool  antiAlias 
)
inline

Draw the image onto the given canvas.

◆ Resized()

Image ScottPlot.Image.Resized ( int  newWidth,
int  newHeight,
bool  antiAlias = true 
)
inline

Return a new image resized to fit the given dimensions.

◆ Save()

SavedImageInfo ScottPlot.Image.Save ( string  path,
ImageFormat  format = ImageFormat::Png,
int  quality = 85 
)
inline

◆ SaveBmp()

SavedImageInfo ScottPlot.Image.SaveBmp ( string  path)
inline

◆ SaveJpeg()

SavedImageInfo ScottPlot.Image.SaveJpeg ( string  path,
int  quality = 85 
)
inline

◆ SavePng()

SavedImageInfo ScottPlot.Image.SavePng ( string  path)
inline

◆ SaveWebp()

SavedImageInfo ScottPlot.Image.SaveWebp ( string  path,
int  quality = 85 
)
inline

◆ Scaled() [1/2]

Image ScottPlot.Image.Scaled ( double  scale,
bool  antiAlias = true 
)
inline

Return a new image with dimensions scaled by the given scale factor. A scale factor of 2.0 will double the size of the returned image.

◆ Scaled() [2/2]

Image ScottPlot.Image.Scaled ( double  scaleX,
double  scaleY,
bool  antiAlias = true 
)
inline

Return a new image with dimensions scaled by the given scale factors. A scale factor of 2.0 will double the size of the returned image.

Property Documentation

◆ Height

int ScottPlot.Image.Height
get

◆ Size

PixelSize ScottPlot.Image.Size
get

◆ SKImage

SKImage ScottPlot.Image.SKImage
getprotected

◆ Width

int ScottPlot.Image.Width
get

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