C# Class AForge.Imaging.Formats.Tools

Set of tools used internally in AForge.Imaging.Formats library.
Datei anzeigen Open project: holisticware-admin/MonoVersal.AForgeNET

Public Methods

Method Description
CreateGrayscaleImage ( int width, int height ) : Bitmap

Create and initialize new grayscale image.

AForge.Imaging.Image.CreateGrayscaleImage() function could be used instead, which does the some. But it was not used to get rid of dependency on AForge.Imaing library.

ReadStream ( Stream stream, byte buffer, int offset, int count ) : int

Read specified amount of bytes from the specified stream.

This tool function guarantees that requested number of bytes was read from the source stream (.NET streams don't guarantee this and may return less bytes than it was requested). Only in the case if end of stream was reached, the function may return with less bytes read.

Method Details

CreateGrayscaleImage() public static method

Create and initialize new grayscale image.

AForge.Imaging.Image.CreateGrayscaleImage() function could be used instead, which does the some. But it was not used to get rid of dependency on AForge.Imaing library.

public static CreateGrayscaleImage ( int width, int height ) : Bitmap
width int Image width.
height int Image height.
return System.Drawing.Bitmap

ReadStream() public static method

Read specified amount of bytes from the specified stream.

This tool function guarantees that requested number of bytes was read from the source stream (.NET streams don't guarantee this and may return less bytes than it was requested). Only in the case if end of stream was reached, the function may return with less bytes read.

public static ReadStream ( Stream stream, byte buffer, int offset, int count ) : int
stream Stream Source sream to read data from.
buffer byte Buffer to read data into.
offset int Offset in buffer to put data into.
count int Number of bytes to read.
return int