---
title: "GraphicsContainer.GetPreferredPixelFormat Method "
canonical: https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_GraphicsContainer_GetPreferredPixelFormat.htm
archived: false
applies_to:
  - product: "Graphics Mill"
    versions: ["12.1", "6.x-12.x (may differ)"]
    entity_id: "https://www.graphicsmill.com/#software-application"
---

# GraphicsContainer.GetPreferredPixelFormat Method 

**Applies to:** Graphics Mill 12.1, 6.x-12.x (may differ)
 
Gets the [PixelFormat](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_PixelFormat.htm.md) that is most often used in this container.
 
**Namespace:** [Aurigma.GraphicsMill.Drawing](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Drawing.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public PixelFormat GetPreferredPixelFormat()
```
 
### Return Value
A [PixelFormat](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_PixelFormat.htm.md) object corresponding to the most often used in this container.
 
## Remarks
 For an empty container GetPreferredPixelFormat() returns [FormatUnknown](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_PixelFormat_FormatUnknown.htm.md) because there is no any element that can define the pixel format.
   
## See Also

### Reference

- [GraphicsContainer Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_GraphicsContainer.htm.md)
- [Aurigma.GraphicsMill.Drawing Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Drawing.htm.md)
