Platforms to show: All Mac Windows Linux Cross-Platform

Back to Picture class.

Picture.EmbeddedMaskMBS(swap as boolean) as picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Graphics & Pictures MBS Picture Plugin 4.0 ✅ Yes ❌ No ✅ Yes ✅ Yes All
Read or write a picture mask.
Example
// Export a mask picture:

dim f as FolderItem
dim t as TiffPictureMBS
dim m,p as Picture
dim q as QTGraphicsExporterMBS

p=New Picture(100,100,32)
p.Graphics.ForeColor=rgb(100,100,100)
p.Graphics.fillrect 0,0,100,100
p.Graphics.ForeColor=rgb(255,0,0)
p.Graphics.fillrect 20,20,80,30

m=New Picture(100,100,32)
m.Graphics.ForeColor=rgb(255,255,255)
m.Graphics.FillRect 0,0,30,100
m.Graphics.ForeColor=rgb(200,200,200)
m.Graphics.FillRect 30,0,30,100
m.Graphics.ForeColor=rgb(100,100,100)
m.Graphics.FillRect 60,0,30,100

p.EmbeddedMaskMBS(true)=m
p.Mask.Graphics.DrawPicture m,0,0 // just for showing as a backdrop

q=new QTGraphicsExporterMBS

q.OpenExporter("TIFF")
q.Depth=32
q.InputPicture=p
q.CompressionQuality=1024
q.OutputFile=SpecialFolder.Desktop.Child("Hello.tif")
title=str(q.Export)

Backdrop=p

Only useful on 32bit images.
Xojo takes white for transparent, so you may need to swap this to black using the swap parameter.

Windows support removed somewhere in version 10.4 with internal changes. If you need this, please tell us.
(Read and Write computed property)

The items on this page are in the following plugins: MBS Picture Plugin.


The biggest plugin in space...