Graphics.Transparency

From Xojo Documentation

Property (As Double )
aGraphics.Transparency = newDoubleValue
or
DoubleValue = aGraphics.Transparency

New in 2011r4

Supported for all project types and targets.

The amount of transparency that affects all drawing to the Graphics object done afterwards. The range is from 0.0 (opaque) to 100.0 (fully transparent). Transparency of the Graphics object can be used to obtain “fading” effects (amongst other uses) by setting the transparency to a value greater than 0.0.

Notes

When rendering colors or pictures with alpha channel information, the Transparency property is composited with the alpha channel information. This allows you to perform uniform fading operations easily and efficiently.

On Windows, using the Transparency property only works on Graphics if the Picture was created with a depth of 32, or is a Picture with an alpha channel. Attempting to use it on other forms of Pictures will result in an UnsupportedOperationException.

Graphics transparency is supported on all platforms.

Examples

Create a picture with a blue rectangle drawn with 50% transparency:

Var boxPic As New Picture(100, 100)
boxPic.Graphics.DrawingColor = &c0000ff00
boxPic.Graphics.Transparency = 50.0
boxPic.Graphics.FillRectangle(0, 0, 100, 100)