VectSharp  2.2.1
A light library for C# vector graphics
VectSharp.MuPDFUtils.RasterImageStream Class Reference

A RasterImage created from a stream. More...

Inheritance diagram for VectSharp.MuPDFUtils.RasterImageStream:

Public Member Functions

 RasterImageStream (Stream imageStream, InputFileTypes fileType, int pageNumber=0, double scale=1, bool alpha=true, bool interpolate=true)
 Creates a new RasterImage from the specified stream. More...
 
 RasterImageStream (IntPtr imageAddress, long imageLength, InputFileTypes fileType, int pageNumber=0, double scale=1, bool alpha=true, bool interpolate=true)
 Creates a new RasterImage from the specified stream. More...
 
- Public Member Functions inherited from VectSharp.RasterImage
 RasterImage (IntPtr pixelData, int width, int height, bool hasAlpha, bool interpolate)
 Creates a new RasterImage instance from the specified pixel data in RGB or RGBA format. More...
 
 RasterImage (ref DisposableIntPtr pixelData, int width, int height, bool hasAlpha, bool interpolate)
 Creates a new RasterImage instance from the specified pixel data in RGB or RGBA format. More...
 
 RasterImage (byte[] data, int width, int height, PixelFormats pixelFormat, bool interpolate)
 Creates a new RasterImage instance copying the specified pixel data. More...
 
void ClearPNGCache ()
 Disposes the PNGStream. Also useful if is is necessary to regenerate it, e.g. because the underlying image pixel data has changed. More...
 
void Dispose ()
 

Additional Inherited Members

- Properties inherited from VectSharp.RasterImage
IntPtr ImageDataAddress [get]
 The memory address of the image pixel data. More...
 
IDisposable DataHolder [get]
 An IDisposable that will be disposed when the image is disposed. More...
 
string Id [get]
 A univocal identifier for this image. More...
 
bool HasAlpha [get]
 Determines whether the image has an alpha channel. More...
 
int Width [get]
 The width in pixels of the image. More...
 
int Height [get]
 The height in pixels of the image. More...
 
bool Interpolate [get]
 Determines whether the image should be interpolated when it is resized. More...
 
MemoryStream PNGStream [get]
 Contains a representation of the image in PNG format. Generated at the first access and cached until the image is disposed. More...
 

Detailed Description

A RasterImage created from a stream.

Definition at line 69 of file RasterImages.cs.

Constructor & Destructor Documentation

◆ RasterImageStream() [1/2]

VectSharp.MuPDFUtils.RasterImageStream.RasterImageStream ( Stream  imageStream,
InputFileTypes  fileType,
int  pageNumber = 0,
double  scale = 1,
bool  alpha = true,
bool  interpolate = true 
)

Creates a new RasterImage from the specified stream.

Parameters
imageStreamThe stream containing the image data.
fileTypeThe type of the image contained in the stream.
pageNumberThe number of the page in the file from which the image should be created, starting at 0. Only useful for multi-page formats, such as PDF.
scaleThe scale factor at which to render the image.
alphaA boolean value indicating whether transparency (alpha) data from the image should be preserved or not.
interpolateA boolean value indicating whether the image should be interpolated when it is resized or not.

Definition at line 80 of file RasterImages.cs.

◆ RasterImageStream() [2/2]

VectSharp.MuPDFUtils.RasterImageStream.RasterImageStream ( IntPtr  imageAddress,
long  imageLength,
InputFileTypes  fileType,
int  pageNumber = 0,
double  scale = 1,
bool  alpha = true,
bool  interpolate = true 
)

Creates a new RasterImage from the specified stream.

Parameters
imageAddressA pointer to the address where the image data is contained.
imageLengthThe length in bytes of the image data.
fileTypeThe type of the image contained in the stream.
pageNumberThe number of the page in the file from which the image should be created, starting at 0. Only useful for multi-page formats, such as PDF.
scaleThe scale factor at which to render the image.
alphaA boolean value indicating whether transparency (alpha) data from the image should be preserved or not.
interpolateA boolean value indicating whether the image should be interpolated when it is resized or not.

Definition at line 148 of file RasterImages.cs.


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