HI there
Here is a code for that:
public static void Test()
{
try
{
RectangleAnnotation obj = new RectangleAnnotation();
// set annotation size
obj.X = 60.0F;
obj.Y = 45.0F;
obj.Width = 561.0F;
obj.Height = 228.0F;
//set annotation edge property
obj.OutLine = new LinePen();
obj.OutLine.Width = 5.0F;//set annotation edge width
obj.OutLine.Brush = new AnnotationBrush();
obj.OutLine.Brush.FillType = RasterEdge.
Imaging Annotation.FillType.Solid;//set annotation edge style
obj.OutLine.Brush.Solid_Color = Color.Blue;//set annotation edge color
//set the property of filled shape
obj.Fill = new AnnotationBrush();
obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid;//set filled shape style
obj.Fill.Solid_Color = Color.Gray;//set filled shape color
//set the property of shadow
obj.ShadowFill = new AnnotationBrush();
obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid;//set shadow style
obj.ShadowFill.Solid_Color = Color.DarkGreen;//set shadow color
obj.ShadowX = 10.0F;//set shadow position
obj.ShadowY = 12.0F;
obj.ShowShadow = true;//show shadow or not
string folderName = "C:/";
Bitmap img = obj.
Create Rectangel Annotation();
img.Save(folderName + "RectangleAnnotation.png");
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
Hope to help you.