Jpeg2000Image Constructor (Stream)
Initializes a new instance of the Jpeg2000Image class.

Namespace: Aspose.Imaging.FileFormats.Jpeg2000
Assembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 21.04
Syntax
public Jpeg2000Image(
	Stream stream
)

Parameters

stream
Type: System.IOStream
The stream to load image from and initialize pixel and palette data with.
Examples
This example shows how to load a JPEG2000 image from a file stream and save it to PNG.
[C#]

string dir = "c:\\temp\\";

// Load a JPEG2000 image from stream.
using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "sample.jp2"))
using (Aspose.Imaging.FileFormats.Jpeg2000.Jpeg2000Image jpeg2000Image = new Aspose.Imaging.FileFormats.Jpeg2000.Jpeg2000Image(stream))
{
    // Save to PNG
    jpeg2000Image.Save(dir + "sample.output.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
See Also