2019R2 : How do I do transparent white in pictures, now ?

Before 2019R2, there was that convenient property that controlled white areas transparency.

aPicture.Transparent = newIntegerValue

Controls the transparency of the white ‘layer’ of the picture.

It can take on either of the following values:

0 - Not transparent.

1 - White is transparent.

It has disappeared.

How do I do that, now ? I suspect it could be done with Mask, but I never used it.

I will appreciate any help :slight_smile:

Transparent was deprecated years ago in favor of Alpha Channels wasn’t it…

I have code I wrote in 2016, where that was used, but even though the code was never recompiled, once I installed Mojave, that feature didn’t seem to work anymore.

Michel… here is some code that will make a mask for a PNG



Dim f As FolderItem
Dim p As picture
dim m as picture
Dim pg As graphics
Dim p_rgb As RGBSurface
Dim m_rgb As RGBSurface

p=picture.Open(f)
pg=p.Graphics
m=new picture(p.Width,p.Height)
//
p_rgb=p.RGBSurface
m_rgb=m.Rgbsurface
m_rgb.FloodFill(0,0,color.white)
For x=0 To pg.Width
  For y=0 To pg.Height
    if p_rgb.pixel(x,y)=color.white then continue
    m_rgb.pixel(x,y)=&c000000
  Next y
Next x
p.ApplyMask(m)
p.Save(f,picture.SaveAsPNG)

Thank you so much, Dave :slight_smile: