Drawing Shapes in Images

When we capture screenshots, we might need to draw some shape over the screenshot to highlight some errors or some object. In such cases, we can use Dot .Net factory wherein we can draw different shapes with different colors. The below code draws rectangle in an image.

Code

Synopsis

The DrawRectangle function requires the following six argument values to be passed.

Argument 1: Image path
Argument 2: X point
Argument 3: Y point
Argument 4: Rectangle Height
Argument 5: Rectangle Width
Argument 6: Color

Note: We can use multiple colors to draw shapes. Refer the below link for different colors.

http://msdn.microsoft.com/en-US/library/system.drawing.pens_members(v=vs.80).aspx

[Total: 1    Average: 5/5]