Show / Hide Table of Contents

Class JpegImage

Main class for work with JPEG images.

Inheritance
System.Object
JpegImage
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: BitMiracle.LibJpeg
Assembly: BitMiracle.LibJpeg.NET.dll
Syntax
public sealed class JpegImage : IDisposable

Constructors

| Improve this Doc View Source

JpegImage(SampleRow[], Colorspace)

Creates JpegImage from pixels

Declaration
public JpegImage(SampleRow[] sampleData, Colorspace colorspace)
Parameters
Type Name Description
SampleRow[] sampleData

Description of pixels.

Colorspace colorspace

Colorspace of image.

See Also
SampleRow
| Improve this Doc View Source

JpegImage(Bitmap)

Creates JpegImage from System.Drawing.Bitmap

Declaration
public JpegImage(Bitmap bitmap)
Parameters
Type Name Description
System.Drawing.Bitmap bitmap

Source .NET bitmap.

| Improve this Doc View Source

JpegImage(Stream)

Creates JpegImage from stream with an arbitrary image data

Declaration
public JpegImage(Stream imageData)
Parameters
Type Name Description
System.IO.Stream imageData

Stream containing bytes of image in arbitrary format (BMP, Jpeg, GIF, PNG, TIFF, e.t.c)

| Improve this Doc View Source

JpegImage(String)

Creates JpegImage from file with an arbitrary image

Declaration
public JpegImage(string fileName)
Parameters
Type Name Description
System.String fileName

Path to file with image in arbitrary format (BMP, Jpeg, GIF, PNG, TIFF, e.t.c)

Properties

| Improve this Doc View Source

BitsPerComponent

Gets the number of bits per color component of Sample.

Declaration
public byte BitsPerComponent { get; }
Property Value
Type Description
System.Byte

The number of bits per color component.

| Improve this Doc View Source

Colorspace

Gets the colorspace of image.

Declaration
public Colorspace Colorspace { get; }
Property Value
Type Description
Colorspace

The colorspace of image.

| Improve this Doc View Source

ComponentsPerSample

Gets the number of color components per Sample.

Declaration
public byte ComponentsPerSample { get; }
Property Value
Type Description
System.Byte

The number of color components per sample.

| Improve this Doc View Source

Height

Gets the height of image in Sample.

Declaration
public int Height { get; }
Property Value
Type Description
System.Int32

The height of image.

| Improve this Doc View Source

Width

Gets the width of image in Sample.

Declaration
public int Width { get; }
Property Value
Type Description
System.Int32

The width of image.

Methods

| Improve this Doc View Source

Dispose()

Frees and releases all resources allocated by this JpegImage

Declaration
public void Dispose()
| Improve this Doc View Source

FromBitmap(Bitmap)

Creates JpegImage from System.Drawing.Bitmap

Declaration
public static JpegImage FromBitmap(Bitmap bitmap)
Parameters
Type Name Description
System.Drawing.Bitmap bitmap

Source .NET bitmap.

Returns
Type Description
JpegImage

Created instance of JpegImage class.

Remarks

Same as corresponding JpegImage(Bitmap).

| Improve this Doc View Source

GetRow(Int32)

Retrieves the required row of image.

Declaration
public SampleRow GetRow(int rowNumber)
Parameters
Type Name Description
System.Int32 rowNumber

The number of row.

Returns
Type Description
SampleRow

Image row of samples.

| Improve this Doc View Source

ToBitmap()

Retrieves image as .NET Bitmap.

Declaration
public Bitmap ToBitmap()
Returns
Type Description
System.Drawing.Bitmap

.NET Bitmap

| Improve this Doc View Source

WriteBitmap(Stream)

Writes decompressed image data as bitmap to stream.

Declaration
public void WriteBitmap(Stream output)
Parameters
Type Name Description
System.IO.Stream output

Output stream.

| Improve this Doc View Source

WriteJpeg(Stream)

Writes compressed JPEG image to stream.

Declaration
public void WriteJpeg(Stream output)
Parameters
Type Name Description
System.IO.Stream output

Output stream.

| Improve this Doc View Source

WriteJpeg(Stream, CompressionParameters)

Compresses image to JPEG with given parameters and writes it to stream.

Declaration
public void WriteJpeg(Stream output, CompressionParameters parameters)
Parameters
Type Name Description
System.IO.Stream output

Output stream.

CompressionParameters parameters

The parameters of compression.

Implements

System.IDisposable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX