<div class="meta" robots="noindex">

</div>

Property

# Picture.Mask

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Picture.ApplyMask<picture.applymask>` and `Picture.CopyMask<picture.copymask>` as a replacement.

</div>

## Description

Allows you to access a <span class="title-ref">Mask</span> that controls the transparency of the picture. By default, the optional Create parameter is `True</api/language/true>`. When Create is `True</api/language/true>`, the <span class="title-ref">Mask</span> is created automatically; otherwise the <span class="title-ref">Mask</span> is returned, whether or not one exists.

## Notes

The <span class="title-ref">Mask</span> property returns Nil when you are using a Picture created with an alpha channel (this includes HiDPI images). You can get at masks by using the `CopyMask<picture.copymask>` and `ApplyMask<picture.applymask>` methods instead.

## Sample code

This example opens a jpeg file and creates a <span class="title-ref">Mask</span>.

``` xojo
Dim p2 As Picture
Dim pic As Picture
Dim f As FolderItem
f = GetOpenFolderItem("image/jpeg")
If f <> Nil Then
  pic = Picture.Open(f)
  p2 = pic.Mask(True)
End If
```

## Compatibility

All project types on all supported operating systems.
