---
title: "Bitmap..::.GetGdiplusGraphics Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Bitmap_GetGdiplusGraphics.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# Bitmap.GetGdiplusGraphics Method 
 
Returns [System.Drawing.Graphics](http://msdn2.microsoft.com/en-us/ac148eb3) object associated with this [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md).
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Function GetGdiplusGraphics As Graphics
```
 
```csharp
public Graphics GetGdiplusGraphics()
```
 
### Return Value
 [System.Drawing.Graphics](http://msdn2.microsoft.com/en-us/ac148eb3) object associated with this [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md).
 
## Examples
  
```
Dim bitmap As New Aurigma.GraphicsMill.Bitmap( _
 Aurigma.GraphicsMill.RgbColor.White, 185, 145, _
 Aurigma.GraphicsMill.PixelFormat.Format24bppRgb)

Dim graphics As System.Drawing.Graphics = bitmap.GetGdiplusGraphics()

graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias

'Draw filled and outlined rectangle
Dim pen As New System.Drawing.Pen(System.Drawing.Color.Red, 3)
Dim brush As New System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(&HFFDDDDFF))
graphics.FillRectangle(brush, 10, 10, 100, 60)
graphics.DrawRectangle(pen, 10, 10, 100, 60)

'Draw filled but non-outlined ellipse
brush.Color = System.Drawing.Color.FromArgb(200, System.Drawing.Color.Yellow)
graphics.FillEllipse(brush, 60, 40, 100, 80)

'Draw outlined but non-filled polygon 
pen.Color = System.Drawing.Color.FromArgb(150, System.Drawing.Color.Green)
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot
pen.Width = 2
Dim points As System.Drawing.Point() = { _
 New System.Drawing.Point(20, 30), New System.Drawing.Point(50, 2), _
 New System.Drawing.Point(180, 30), New System.Drawing.Point(80, 140)}
graphics.DrawPolygon(pen, points)
```
 
```csharp
Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap(
    Aurigma.GraphicsMill.RgbColor.White, 185, 145, 
    Aurigma.GraphicsMill.PixelFormat.Format24bppRgb);

System.Drawing.Graphics graphics = bitmap.GetGdiplusGraphics();

graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

//Draw filled and outlined rectangle
System.Drawing.Pen pen = new System.Drawing.Pen(System.Drawing.Color.Red, 3);
System.Drawing.SolidBrush brush = new System.Drawing.SolidBrush(
    System.Drawing.Color.FromArgb(0xFF, 0xDD, 0xDD, 0xFF));
graphics.FillRectangle(brush, 10, 10, 100, 60);
graphics.DrawRectangle(pen, 10, 10, 100, 60);

//Draw filled but non-outlined ellipse
brush.Color = System.Drawing.Color.FromArgb(200, System.Drawing.Color.Yellow);
graphics.FillEllipse(brush, 60, 40, 100, 80);

//Draw outlined but non-filled polygon 
pen.Color = System.Drawing.Color.FromArgb(150, System.Drawing.Color.Green);
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
pen.Width = 2;
System.Drawing.Point[] points = { 
    new System.Drawing.Point(20, 30), new System.Drawing.Point(50, 2), 
    new System.Drawing.Point(180, 30), new System.Drawing.Point(80, 140)};
graphics.DrawPolygon(pen, points);
```
   
## See Also

### Reference

- [Bitmap Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
