Picture.HasAlphaChannel

From Xojo Documentation

Revision as of 00:27, 25 July 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Read-Only Property (As Boolean )
BooleanValue = aPicture.HasAlphaChannel

New in 2011r4

Supported for all project types and targets.

True if the Picture has an alpha channel.

Notes

A Picture that is created with the constructor that omits the Depth parameter has an alpha channel and old pictures can be converted to this format with the following code:

Function ConvertToAlphaPicture(input As Picture) As Picture
If input.HasAlphaChannel Then Return input

Var result As New Picture(input.Width, input.Height)
result.Graphics.DrawPicture(input, 0, 0)
Return result
End Function

For pictures using masks, HasAlphaChannel returns False.