Picture.Constructor(width as Integer, height as Integer)

From Xojo Documentation

Constructor
Picture.Constructor(width as Integer, height as Integer)

New in 2011r4

A Picture created with this constructor supports an alpha channel directly instead of requiring the use of masks.

Exceptions

Exception Reason
OutOfBoundsException Raised if Width and Height are outside the range 1 - 32767.
OutOfMemoryException Raised if there is not enough memory to create the picture.

Notes

This constructor creates a Picture instance with alpha channel support using the passed width and height parameters. Both Width and Height must be in the range 1 - 32767, otherwise an OutOfBoundsException is raised. Width and Height specify the size of the picture in pixels.

When this constructor is used, the Picture defaults to translucent and can be returned to that state using ClearRect.

A picture created with a bit depth defaults to having a white, opaque background. Calling ClearRect on it returns it to that state.

Pictures created with an alpha channel do not use a mask. The Mask property will be Nil. Use the CopyMask and ApplyMask methods if you need to work with masks.

Sample Code

This code creates a new Picture with an alpha channel:

Var pic As New Picture(2000, 2000)