---
title: "Bitmap Constructor (Int32, Int32, PixelFormat)"
canonical: https://www.graphicsmill.com/docs/gm5/C_Aurigma_GraphicsMill_Bitmap_ctor_3_f379b74d.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 Constructor (Int32, Int32, PixelFormat)
 
Creates new [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md) instance of given dimensions and pixel format.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Sub New ( _width As Integer, _height As Integer, _format As PixelFormat _
)
```
 
```csharp
public Bitmap(int width,int height,PixelFormat format
)
```
 
### Parameters
 
 - width
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Width of new bitmap (in pixels).

 - height
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Height of new bitmap (in pixels).

 - format
     - Type: [Aurigma.GraphicsMill.PixelFormat](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_PixelFormat.htm.md)
Pixel format of new bitmap. If you specify indexed pixel format, uninitialized palette will be generated. You must fill entries yourself. Palette will have maximum possible for given pixel format colors number (2 colors for 1-bit images, 16 colors for 4-bit images, and 256 colors for 8-bit images).
 
## Remarks
 All pixel data are filled with 0. So if pixel format: 
- **supports alpha channel**  image is fully transparent
- **is RGB**  image is filled with black color
- **is CMYK**  image is filled with white color
- **is indexed**  image has color of the first palette entry
 
## Examples
  
```
'Create bitmap with transparent background
Dim bitmapText As New Aurigma.GraphicsMill.Bitmap(150, 30, _
    Aurigma.GraphicsMill.PixelFormat.Format32bppArgb)

Dim graphics As System.Drawing.Graphics = bitmapText.GetGdiplusGraphics()

'Set text output properties
Dim font As New System.Drawing.Font("Arial", 22, FontStyle.Bold)
Dim brush As New System.Drawing.SolidBrush(System.Drawing.Color.Red)

'Draw text
graphics.DrawString("Sample text", font, brush, 5, 5)

'Apply shadow effect on text
bitmapText.Transforms.Shadow(Aurigma.GraphicsMill.RgbColor.Black, 2, 2, 4, False)

'Apply glow effect on text
'bitmapText.Transforms.Glow(Aurigma.GraphicsMill.RgbColor.Blue, 1, 4, False)

'Convert to 24 bit images (merge alpha channel with white background)
bitmapText.Channels.DiscardAlpha(Aurigma.GraphicsMill.RgbColor.White)
```
 
```csharp
//Create bitmap with transparent background
Aurigma.GraphicsMill.Bitmap bitmapText = new Aurigma.GraphicsMill.Bitmap(150, 30, 
    Aurigma.GraphicsMill.PixelFormat.Format32bppArgb);

System.Drawing.Graphics graphics = bitmapText.GetGdiplusGraphics();

//Set text output properties
System.Drawing.Font font = new System.Drawing.Font("Arial", 22, FontStyle.Bold);
System.Drawing.SolidBrush brush = new System.Drawing.SolidBrush(System.Drawing.Color.Red);

//Draw text
graphics.DrawString("Sample text", font, brush, 5, 5);

//Apply shadow effect on text
bitmapText.Transforms.Shadow(Aurigma.GraphicsMill.RgbColor.Black, 2, 2, 4, false);

//Apply glow effect on text
//bitmapText.Transforms.Glow(Aurigma.GraphicsMill.RgbColor.Blue, 1, 4, false);

//Convert to 24 bit images (merge alpha channel with white background)
bitmapText.Channels.DiscardAlpha(Aurigma.GraphicsMill.RgbColor.White);
```
   
## See Also

### Reference

- [Bitmap Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
- [Bitmap Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Bitmap_ctor.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
