FillColor and Alpha channel

Is it possible to use alpha channel for a fillcolor? (At least using Windows. I have not checked it in macOS yet)
Using this code

Dim Pic as new Picture(100,100) Pic.Graphics.ForeColor = &c000000FF pic.Graphics.FillRect(0, 0, 100, 100)

All pixels are &c00000000 instead of &c000000FF.
Is this a bug or expected behaviour.
In LR, all examples are without alpha channel.

Have you tried setting the Graphics.Transparency property?

your example works fine under OSX/macOS

Thanks for checking.[quote=310294:@Greg O’Lone]Have you tried setting the Graphics.Transparency property?[/quote]
No. It doesn’t work. With this code:
Dim Pic as new Picture(100,100) Pic.Graphics.Transparency = 100 Pic.Graphics.ForeColor = &c000000FF pic.Graphics.FillRect(0, 0, 100, 100)
I have the same result.
In fact I had already filed a bug report <https://xojo.com/issue/46626>

No I got alpha=0 on also on mac

I just ran into this issue today and am adding points to increase its Feedback ranking.

Windows 10, Xojo 2016 r4.1

Wait a sec… what exactly are you expecting this to do for you?

Hi Greg,

The example that I am working on takes many pictures and either blends or overlays them based on their alpha values. The alpha values are read pixel-by-pixel and the final alpha value is used when overlapping pictures.

Its also really handy to know the alpha value when working with mixing pictures with masks and alpha values. :slight_smile: I just spent a few hours on code that had the alpha value returned as a 0 when it was actually 255.

Here are some links on Transparency Flattening - I usually call it alpha flattening.
Transparency Flattening or
Transparency Flattening

[quote=316999:@Eugene Dakin]Here are some links on Transparency Flattening - I usually call it alpha flattening.
Transparency Flattening or
Transparency Flattening[/quote]
Ok. I was just making sure that you’re not expecting it to change the opacity of the overall canvas.

Your correct, I was not expecting it to change the opacity of the overall canvas. I am expecting this to change the opacity of a picture so that when many pictures are added together, then the single merged final picture can be shown on a Canvas.