---
title: "Draw Using Advanced Graphics"
canonical: https://www.graphicsmill.com/samples/LargeImages/Drawing/DrawUsingAdvancedGraphics_cs
product: "Graphics Mill"
source: "LargeImages/Drawing/DrawUsingAdvancedGraphics.cs"
---

# Draw Using Advanced Graphics

Performs drawing with AdvancedDrawing in the Pipeline API.

## Instruction

Draw a green-yellow rectangle around the edges of an image using advanced graphics in Pipeline API and save it.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
using Aurigma.GraphicsMill.Drawing;
```

## Code Snippet

```csharp
using (var reader = ImageReader.Create("Venice.jpg"))
using (var drawer = new Drawer())
using (var writer = ImageWriter.Create("DrawUsingAdvancedGraphics.jpg"))
{
    drawer.Draw += (sender, e) =>
    {
        var pen = new Pen(System.Drawing.Color.GreenYellow, 30);

        e.Graphics.DrawRectangle(pen, new System.Drawing.RectangleF(15, 15, e.Width - 30, e.Height - 30));
    };

    Aurigma.GraphicsMill.Pipeline.Run(reader + drawer + writer);
}
```

## Explanation

The code:

- Reads the image "Venice.jpg".
- Draws a green-yellow rectangle around the edges using advanced graphics.
- Saves the result to "DrawUsingAdvancedGraphics.jpg".

## Tags

- [Drawing](<https://www.graphicsmill.com/samples/tags/drawing_md>): Drawing vector shapes and text
- [Pipeline](<https://www.graphicsmill.com/samples/tags/pipeline_md>): Working with images via the Pipeline API

## Input

- [Venice.jpg](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/Venice_jpg>) (preview)

## Output

- [DrawUsingAdvancedGraphics.jpg](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/DrawUsingAdvancedGraphics_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Codecs.ImageReader](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_ImageReader.htm.md>)
- [Aurigma.GraphicsMill.Codecs.ImageReader.Create(String)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_ImageReader_Create_1_bb3a7a4f.htm.md>)
- [Aurigma.GraphicsMill.Codecs.ImageWriter](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_ImageWriter.htm.md>)
- [Aurigma.GraphicsMill.Codecs.ImageWriter.Create(String)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_ImageWriter_Create_1_bb3a7a4f.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Drawer](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_Drawer.htm.md>)
- [Aurigma.GraphicsMill.Drawing.DrawEventArgs.Graphics](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Drawing_DrawEventArgs_Graphics.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Graphics.DrawRectangle(Pen,RectangleF)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Graphics_DrawRectangle_2_169e24a7.htm.md>)
- [Aurigma.GraphicsMill.Drawing.Pen](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_Pen.htm.md>)
