Platforms to show: All Mac Windows Linux Cross-Platform

Back to TiffPictureMBS class.

Previous items

TiffPictureMBS.WriteRGB as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 4.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Writes a RGB image.
Example
dim m,p as Picture
dim f as FolderItem
dim t as TiffPictureMBS
dim g as Graphics

p=New Picture(100,100,32)
m=New Picture(100,100,32)

p.Graphics.ForeColor=Rgb(0,255,0) // fill green
p.Graphics.Fillrect 0,0,100,100

p.Graphics.ForeColor=Rgb(255,0,0) // fill red
p.Graphics.FillOval 0,0,100,100

m.Graphics.ForeColor=Rgb(0,0,0) // fill black (invisible so green not seen)
m.Graphics.Fillrect 0,0,100,100

m.Graphics.ForeColor=Rgb(255,255,255) // fill white (Visible)
m.Graphics.FillOval 0,0,100,100

f=SpecialFolder.Desktop.Child("test.tif")

t=new TiffPictureMBS
t.Pict=p
t.Mask=m

if t.Create(f) then
if t.WriteRGB then
t.Close
MsgBox "Ok"
f.Launch
end if
end if

Uses the pictures in the mask and pict properties to write a picture.
If mask is set, the picture is saved with an alpha channel.

The following settings are made before the image data is written:
PlanarConfig = PLANARCONFIG_CONTIG
Photometric = PHOTOMETRIC_RGB
BitsPerSample = 8
SamplesPerPixel = 3
FillOrder = FILLORDER_MSB2LSB
VerticalResolution = 72
HorizontalResolution = 72
Orientation = ORIENTATION_TOPLEFT
ResolutionUnit = RESUNIT_INCH
Compression = COMPRESSION_NONE

You may change settings before or later. For example if you set Compression before it should be used for writing image data to the file.
Returns true on success.

This method uses the YieldTicks property and may yield time to other threads.

Some examples using this method:

Previous items

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


💬 Ask a question or report a problem
The biggest plugin in space...