Jpeg2000Image Constructor (Int32, Int32)
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(
	int width,
	int height
)

Parameters

width
Type: SystemInt32
The image width
height
Type: SystemInt32
The image height
Examples
This example shows how to create a JPEG2000 image and save it to a file.
[C#]

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

// Create a JPEG2000 image of 100x100 px.
using (Aspose.Imaging.FileFormats.Jpeg2000.Jpeg2000Image jpeg2000Image = new Aspose.Imaging.FileFormats.Jpeg2000.Jpeg2000Image(100, 100))
{
    Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(jpeg2000Image);

    // Fill the entire image in red.
    Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);
    graphics.FillRectangle(brush, jpeg2000Image.Bounds);

    // Save to a file
    jpeg2000Image.Save(dir + "sample.output.jp2", new Aspose.Imaging.ImageOptions.Jpeg2000Options());
}
See Also