---
title: "Bitmap Constructor (Int32, Int32, PixelFormat, ColorPalette)"
canonical: https://www.graphicsmill.com/docs/gm/C_Aurigma_GraphicsMill_Bitmap_ctor_4_803cbb00.htm
product: "Graphics Mill"
---

# Bitmap Constructor (Int32, Int32, PixelFormat, ColorPalette)
 
Initializes a new instance of the [Bitmap](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md) class with the specified size, pixel format, and palette.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public Bitmap(int width,int height,PixelFormat format,ColorPalette palette
)
```
 
### Parameters
 
 - width
     - Type: System.Int32
The width, in pixels, of the new [Bitmap](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md).

 - height
     - Type: System.Int32
The height, in pixels, of the new [Bitmap](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md).

 - format
     - Type: [Aurigma.GraphicsMill.PixelFormat](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_PixelFormat.htm.md)
The pixel format for the new [Bitmap](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md). If you specify indexed pixel format, uninitialized palette will be generated. You must fill entries by 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).

 - palette
     - Type: [Aurigma.GraphicsMill.ColorPalette](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_ColorPalette.htm.md)
The palette attached to the new [Bitmap](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md). Note, this palette object is binded to bitmap, not copied. It means that if you later change anything in this palette object, changes will be reflected in the palette of bitmap.
 
## 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.
   
## See Also

### Reference

- [Bitmap Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md)
- [Bitmap Overload](https://www.graphicsmill.com/docs/gm/O_T_Aurigma_GraphicsMill_Bitmap_ctor.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill.htm.md)
