Image Constructor
Initializes a new instance of the Image class.

Namespace: Aspose.PSD
Assembly: Aspose.PSD (in Aspose.PSD.dll) Version: 20.6
protected Image()
The following example demonstrates how you can draw on a newly created layer if the simple constructor version is used in Aspose.PSD

string outputFilePath = "output.psd";

int width = 100;
int height = 100;
using (var image = new PsdImage(width, height))
    var layer = new Layer();
    layer.Bottom = height;
    layer.Right = width;

    Graphics graphic = new Graphics(layer);

    // draw a rectangle with Pen tool
    graphic.DrawRectangle(new Pen(Color.Red), new Rectangle(30, 10, 40, 80));

    // draw another rectangle with Solid Brush in Blue color
    graphic.DrawRectangle(new Pen(new SolidBrush(Color.Blue)), new Rectangle(10, 30, 80, 40));

See Also