---
title: "MaskedBitmapTransform..::.ApplyMaskTransform Method (BitmapData, Bitmap)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Transforms_MaskedBitmapTransform_ApplyMaskTransform_2_14d25d91.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/)

# MaskedBitmapTransform.ApplyMaskTransform Method (BitmapData, Bitmap)
 
Transforms given bitmap data "in-place" using specified mask.
 
**Namespace:** [Aurigma.GraphicsMill.Transforms](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Transforms.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Overridable Sub ApplyMaskTransform ( _bitmapData As BitmapData, _mask As Bitmap _
)
```
 
```csharp
public virtual void ApplyMaskTransform(BitmapData bitmapData,Bitmap mask
)
```
 
### Parameters
 
 - bitmapData
     - Type: [Aurigma.GraphicsMill.BitmapData](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_BitmapData.htm.md)
 [BitmapData](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_BitmapData.htm.md) which should be transformed. Result of the transform will be saved to the same bitmap data (in other word, transform is applied "in-place").

 - mask
     - Type: [Aurigma.GraphicsMill.Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
 [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md) which defines mask. Mask should be 8-bit grayscale bitmap (its pixel format is [Format8bppGrayScale](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_PixelFormat.htm.md)) of the same dimensions as original image.
 
## Remarks
 You can create empty mask for the bitmap using [GetEmptyMask()](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Bitmap_GetEmptyMask.htm.md) method. This method always returns mask with proper dimensions and pixel format. Initially this mask is fully transparent (filled with black pixels). You should draw necessary non-transparent areas yourself.
   
## See Also

### Reference

- [MaskedBitmapTransform Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_MaskedBitmapTransform.htm.md)
- [ApplyMaskTransform Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Transforms_MaskedBitmapTransform_ApplyMaskTransform.htm.md)
- [Aurigma.GraphicsMill.Transforms Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Transforms.htm.md)
