Gets or sets the brush opacity. The value should be between 0 and 1. Value of 0 means that brush is fully visible, value of 1 means the brush is fully opaque.
This example uses Graphics class to create primitive shapes on the Image surface. To demonstrate the operation, the example creates a new Image in PSD format and draw primitive shapes on Image surface using Draw methods exposed by Graphics class then export it to PSD file format.
[C#]//Create an instance of Image using(Aspose.PSD.Imageimage=newAspose.PSD.FileFormats.Psd.PsdImage(500,500)){//Create and initialize an instance of Graphics classAspose.PSD.Graphicsgraphics=newAspose.PSD.Graphics(image);//Clear Graphics surfacegraphics.Clear(Color.Wheat);//Draw an Arc by specifying the Pen object having Black color, //a Rectangle surrounding the Arc, Start Angle and Sweep Anglegraphics.DrawArc(newPen(Color.Black,2),newRectangle(200,200,100,200),0,300);//Draw a Bezier by specifying the Pen object having Blue color and co-ordinate Points.graphics.DrawBezier(newPen(Color.Blue,2),newPoint(250,100),newPoint(300,30),newPoint(450,100),newPoint(235,25));//Draw a Curve by specifying the Pen object having Green color and an array of Pointsgraphics.DrawCurve(newPen(Color.Green,2),new[]{newPoint(100,200),newPoint(100,350),newPoint(200,450)});//Draw an Ellipse using the Pen object and a surrounding Rectanglegraphics.DrawEllipse(newPen(Color.Yellow,2),newRectangle(300,300,100,100));//Draw a Line graphics.DrawLine(newPen(Color.Violet,2),newPoint(100,100),newPoint(200,200));//Draw a Pie segmentgraphics.DrawPie(newPen(Color.Silver,2),newRectangle(newPoint(200,20),newSize(200,200)),0,45);//Draw a Polygon by specifying the Pen object having Red color and an array of Pointsgraphics.DrawPolygon(newPen(Color.Red,2),new[]{newPoint(20,100),newPoint(20,200),newPoint(220,20)});//Draw a Rectanglegraphics.DrawRectangle(newPen(Color.Orange,2),newRectangle(newPoint(250,250),newSize(100,100)));//Create a SolidBrush object and set its various propertiesAspose.PSD.Brushes.SolidBrushbrush=newAspose.PSD.Brushes.SolidBrush();brush.Color=Color.Purple;brush.Opacity=100;//Draw a String using the SolidBrush object and Font, at specific Pointgraphics.DrawString("This image is created by Aspose.PSD API",newFont("Times New Roman",16),brush,newPointF(50,400));//Create an instance of PngOptions and set its various propertiesAspose.PSD.ImageOptions.PngOptionspngOptions=newAspose.PSD.ImageOptions.PngOptions();// save all changes.image.Save("C:\\temp\\output.png",pngOptions);}