MBS Plugin Documentation

Search:

Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchie

New in Version 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 9.0

The list of the   themes,   classes,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

Previous items Next items

TiffPictureMBS.Orientation as integer
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 3.1, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: The orientation of this image.
Example:
// creates a tif file with a horizontal flipped image
// red rectangle is on the left in the image data, but with orientation tag it should be displayed on the right side.
// Mac OS X Preview.app shows it correctly.

dim p as Picture
dim t as TiffPictureMBS
dim f as FolderItem

const ORIENTATION_TOPLEFT = 1 //* row 0 top, col 0 lhs */
const ORIENTATION_TOPRIGHT = 2 //* row 0 top, col 0 rhs */
const ORIENTATION_BOTRIGHT = 3 //* row 0 bottom, col 0 rhs */
const ORIENTATION_BOTLEFT = 4 //* row 0 bottom, col 0 lhs */
const ORIENTATION_LEFTTOP = 5 //* row 0 lhs, col 0 top */
const ORIENTATION_RIGHTTOP = 6 //* row 0 rhs, col 0 top */
const ORIENTATION_RIGHTBOT = 7 //* row 0 rhs, col 0 bottom */
const ORIENTATION_LEFTBOT = 8 //* row 0 lhs, col 0 bottom */

p=NewPicture(150,100,32)

p.Graphics.ForeColor=rgb(255,0,0)
p.Graphics.FillRect 0,0,10,10

t=new TiffPictureMBS
f=DesktopFolder.Child("test.tif")

if t.Create(f) then
t.Pict=p

t.Orientation=ORIENTATION_TOPRIGHT
if t.WriteRGB then
end if
t.Orientation=ORIENTATION_TOPRIGHT

t.Close
end if

Notes:
Orientation:

The orientation of the image with respect to the rows and columns.
Tag = 274 (112.H)
Type = SHORT
N = 1
1 = The 0th row represents the visual top of the image, and the 0th column represents the visual left-hand side.
2 = The 0th row represents the visual top of the image, and the 0th column represents the visual right-hand side.
3 = The 0th row represents the visual bottom of the image, and the 0th column represents the visual right-hand side.
4 = The 0th row represents the visual bottom of the image, and the 0th column represents the visual left-hand side.
5 = The 0th row represents the visual left-hand side of the image, and the 0th column represents the visual top.
6 = The 0th row represents the visual right-hand side of the image, and the 0th column represents the visual top.
7 = The 0th row represents the visual right-hand side of the image, and the 0th column represents the visual bottom.
8 = The 0th row represents the visual left-hand side of the image, and the 0th column represents the visual bottom.

Default is 1.
Support for orientations other than 1 is not a Baseline TIFF requirement.
(This text was sent in by David Austin)
(Read and Write property)
TiffPictureMBS.OutputBuffer as String
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 5.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: The current output data from the CreateString function.
Notes:
Between CreateString and Close the plugin will record all the output data and you can get a copy using this property.
(Read only property)
TiffPictureMBS.PageName as String
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: The name of the current page.
Notes:
The data for this property is stored in the Tiff file.
(Read and Write property)
TiffPictureMBS.Photometric as integer
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 3.1, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: A property of the TIFF image.
Example:
// read and write a BW fax tiff with compression

dim d as new OpenDialog()
dim f as FolderItem = GetFolderItem("myfax.tiff")
if f = nil then
return
end if

dim tiff as new TiffPictureMBS()
if not tiff.Open(f) then
MsgBox("Error while opening.")
return
end if

if not tiff.ReadBW() then
MsgBox("Error reading.")
end if

dim tiff2 as TiffPictureMBS = new TiffPictureMBS()

dim f2 as FolderItem = DesktopFolder.Child("Copy.tiff")
if not tiff2.Create(f2) then
MsgBox("Error creating file.")
end if

const COMPRESSION_CCITTFAX3=3
const WhiteIsZero=0
const BlackIsZero=1

tiff2.Pict = tiff.pict
tiff2.Photometric=WhiteIsZero
tiff2.Compression=COMPRESSION_CCITTFAX3
if not tiff2.WriteBW() then
MsgBox("Error writing.") // Error
end if

tiff2.Close()

Notes:
PhotometricInterpretation:
The color space of the image data.
Tag = 262 (106.H)
Type = SHORT
N = 1

0 = WhiteIsZero. For bilevel and grayscale images: 0 is imaged as white. 2**BitsPerSample-1 is imaged as black. This is the normal value for Compression=2.

1 = BlackIsZero. For bilevel and grayscale images: 0 is imaged as black. 2**BitsPerSample-1 is imaged as white. If this value is specified for Compression=2, the image should display and print reversed.

2 = RGB. In the RGB model, a color is described as a combination of the three primary colors of light (red, green, and blue) in particular concentrations. For each of the three components, 0 represents minimum intensity, and 2**BitsPerSample - 1 represents maximum intensity. Thus an RGB value of (0,0,0) represents black, and (255,255,255) represents white, assuming 8-bit components. For PlanarConfiguration = 1, the components are stored in the indicated order: first Red, then Green, then Blue. For PlanarConfiguration = 2, the StripOffsets for the component planes are stored in the indicated order: first the Red component plane StripOffsets, then the Green plane StripOffsets, then the Blue plane StripOffsets.

3= Palette color. In this model, a color is described with a single component. The value of the component is used as an index into the red, green and blue curves in the ColorMap field to retrieve an RGB triplet that defines the color. When PhotometricInterpretation=3 is used, ColorMap must be present and SamplesPerPixel must be 1.

4 = Transparency Mask. This means that the image is used to define an irregularly shaped region of another image in the same TIFF file. SamplesPerPixel and BitsPerSample must be 1. PackBits compression is recommended. The 1-bits define the interior of the region; the 0-bits define the exterior of the region. A reader application can use the mask to determine which parts of the image to display. Main image pixels that correspond to 1-bits in the transparency mask are imaged to the screen or printer, but main image pixels that correspond to 0-bits in the mask are not displayed or printed. The image mask is typically at a higher resolution than the main image, if the main image is grayscale or color so that the edges can be sharp.

There is no default for PhotometricInterpretation, and it is required. Do not rely on applications defaulting to what you want.
(This text was sent in by David Austin)

For more details see:
<http://partners.adobe.com/asn/developer/pdfs/tn/TIFF6.pdf>
(Read and Write property)
TiffPictureMBS.pict as picture
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: The picture data of the picture.
Notes: (Read and Write property)
TiffPictureMBS.PlanarConfig as Integer
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: The storage organization used.
Notes:
Value is 1 for a single image plane and 2 for separated planes.

The data for this property is stored in the Tiff file.
(Read and Write property)
TiffPictureMBS.Progress(line as integer, total as integer)
event, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 6.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Reports changes in progress.
Notes: Used in CombineBitCMYKtoCMYK, CombineTiffCMYKtoRGB and CombineTiffCMYKtoCMYK methods.
TiffPictureMBS.ReadBW as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Reads the current picture in BW mode.
Example:
dim f as FolderItem
dim p as Picture

f=DesktopFolder.Child("Multipage fax.tif")
t=f.OpenAsTiffMBS(true)

if t.ReadBW then
title=str(t.ImageCount)

p=t.pict
Title=str(p.Depth)
Canvas1.Backdrop=p
end if

Notes:
Returns true on success and false on any error.
Only if the current picture is a 1bit black&white picture, a new picture is created in the pict property and the data is copied inside.

Data in the TIFF file must be in 1 bit BW mode. Else use ReadRGB which does a lot of converting.

This method uses the YieldTicks property and may yield time to other threads.
TiffPictureMBS.ReadBW(left as integer, top as integer, width as integer, height as integer) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 8.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Reads the current picture in BW mode.
Example:
dim f as FolderItem
dim p as Picture

f=DesktopFolder.Child("Multipage fax.tif")
t=f.OpenAsTiffMBS(true)

if t.ReadBW(0,0,t.width/2,t.height/2) then
title=str(t.ImageCount)

p=t.pict
Title=str(p.Depth)
Canvas1.Backdrop=p
end if

Notes:
Returns true on success and false on any error.
Only if the current picture is a 1bit black&white picture, a new picture is created in the pict property and the data is copied inside.

Data in the TIFF file must be in 1 bit BW mode. Else use ReadRGB which does a lot of converting.

This method uses the YieldTicks property and may yield time to other threads.
TiffPictureMBS.ReadRGB as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Reads a CMYK or RGB picture and stores it in the pict and name properties.
Notes:
Returns true on success.
ReadRGB does converting on the picture data if needed so you can read CMYK, RGB, BW and other image data using this function.
TiffPictureMBS.ReadRGB(byref ErrorMessage as string) as memoryblock
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 9.0, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Reads the image into a memoryblock as RGB.
Notes:
The Scanline() array gives you the raw uncompressed data. But this method decodes the data into a RGBA image.

The Memoryblock has the size of 4*width*height. Each pixel has one byte for red, one byte for green, one byte for blue and one byte for alpha. If no alpha is in the file, all pixels have the same alpha of 255.

If the decompression fails the function returns nil. (e.g. out of memory).
If the decoding fails, you also get an error message.
TiffPictureMBS.ResolutionUnit as Integer
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Which unit is used for the Resolution values.
Notes:
constants:
RESUNIT_NONE1no meaningful units
RESUNIT_INCH2english
RESUNIT_CENTIMETER3metric

The data for this property is stored in the Tiff file.
(Read and Write property)
TiffPictureMBS.RewriteDirectory as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 8.7, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Writes existing picture and header information to file replacing the old data.
Notes:
Returns true on success and false on any error.
As the data is added to the file and just the reference to the old data is deleted, the filesize will grow.

Calls TIFFReWriteDirectory internally.
TiffPictureMBS.RowsPerStrip as Integer
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: A property of the TIFF image.
Notes:
Should be same as the height for our uses. (with one strip)
(Read and Write property)
TiffPictureMBS.SamplesPerPixel as integer
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 3.1, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: The count of components used for each pixel.
Notes:
SamplesPerPixel= 1=Grayscale, 3=RGB, 4=CMYK, ...
Photometric= 0 or 1=Grayscale depending on white point, 2=RGB, 5=CMYK, ...

For other formats see:
<http://partners.adobe.com/asn/developer/pdfs/tn/TIFF6.pdf>
(Read and Write property)
TiffPictureMBS.SaveImage as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 7.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Writes existing picture and header information to file replacing the old data.
Notes:
Returns true on success and false on any error.
As the data is added to the file and just the reference to the old data is deleted, the filesize will grow.

Calls TIFFReWriteDirectory internally.
TiffPictureMBS.Scanline(index as integer) as memoryblock
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: An image scanline.
Notes:
Returns nil on any error.
If you set the value, make sure the Memoryblock is big enought. The BytesPerRow functions returns the number of bytes needed.

The data for this property is stored in the Tiff file.
The first scanline has the index of 0.
(Read and Write runtime property)
TiffPictureMBS.Scanlines(index as integer, count as integer) as memoryblock
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Serveral image scanlines.
Notes:
Returns nil on any error.
If you set the value, make sure the Memoryblock is big enought. The BytesPerRow functions returns the number of bytes needed.

The data for this property is stored in the Tiff file.
The first scanline has the index of 0. Count is the number of scanlines you want to read/write.
(Read and Write runtime property)
TiffPictureMBS.SetColorProfile(ProfileData as String) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 7.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Sets the color profile for this tiff file.
Notes: Returns true on success and false on failure.
TiffPictureMBS.SetData(Tag as integer, data as string) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 8.5, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Writes the string for this tag.
TiffPictureMBS.SetFieldByte(Tag as integer, value as integer) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 8.7, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Sets the tiff data field with the given tag to the given value.
Notes:
Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.
TiffPictureMBS.SetFieldDouble(Tag as integer, value as double) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 7.0, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Sets the tiff data field with the given tag to the given value.
Notes:
Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.
TiffPictureMBS.SetFieldInteger(Tag as integer, value as integer) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 7.0, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Sets the tiff data field with the given tag to the given value.
Example:
dim t as TiffPictureMBS
dim f as FolderItem

const TIFFTAG_IMAGELENGTH=257 // integer
const TIFFTAG_IMAGEWIDTH=256 // integer

f=GetTemporaryFolderItem
t=new TiffPictureMBS

if t.Create(f) then

if t.SetFieldInteger(TIFFTAG_IMAGELENGTH,100) then
if t.Height=100 then
MsgBox "ok"
end if
end if

end if

Notes:
Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.
TiffPictureMBS.SetFieldMemory(Tag as integer, ItemCount as integer, data as memoryblock) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 8.7, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Sets the tiff data field with the given tag to the given value.
Notes:
This is the special version of the setter which passes a memoryblock and a count value so you can set an array using this method.

Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.
TiffPictureMBS.SetFieldShort(Tag as integer, value as integer) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 7.0, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Sets the tiff data field with the given tag to the given value.
Notes:
Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.
TiffPictureMBS.SetFieldSingle(Tag as integer, value as Single) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 8.7, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Sets the tiff data field with the given tag to the given value.
Notes:
Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.
TiffPictureMBS.SetFieldString(Tag as integer, value as string) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 8.4, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Sets one of the fields to the value of the string.
Example:
dim m,p as Picture
dim f as FolderItem
dim t as TiffPictureMBS
dim g as Graphics
dim s as string

// make pictures
p=NewPicture(100,100,32)
m=NewPicture(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

// save
f=DesktopFolder.Child("test.tif")

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

if t.Create(f) then
if t.WriteRGB then

const TIFFTAG_SOFTWARE=305

s="Example Software"
call t.SetFieldString TIFFTAG_SOFTWARE,s

const TIFFTAG_HOSTCOMPUTER=316

s="Example HostComputer"
call t.SetFieldString TIFFTAG_HOSTCOMPUTER,s

const TIFFTAG_IMAGEDESCRIPTION=270

s="Example ImageDescription"
call t.SetFieldString TIFFTAG_IMAGEDESCRIPTION,s

const TIFFTAG_MAKE=271

s="Example Make"
call t.SetFieldString TIFFTAG_MAKE,s

const TIFFTAG_ARTIST=315

s="Example Artist"
call t.SetFieldString TIFFTAG_ARTIST,s

t.Close
MsgBox "Ok"
f.Launch
end if
end if


Notes:
Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.
You have to pass in the string with the correct encoding.
TiffPictureMBS.SetImageIndex(index as integer) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Sets the current image index and reads the new image.
Example:
if t.SetImageIndex(1) then
Canvas1.Backdrop=t.pict
end if

Notes:
Reads automatically a RGB picture for you, so the pict property is filled on success.
Returns true on success.
TiffPictureMBS.SetImageIndex(index as integer, HeaderOnly as boolean) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Sets the current image index.
Notes:
If HeaderOnly is false the current picture is read into the pict&mask properties.
Returns true on success.
TiffPictureMBS.SetXMP(ProfileData as String) as boolean
method, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 7.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: Sets the xmp metadata package for this tiff file.
Notes: Returns true on success and false on failure.
TiffPictureMBS.Software as String
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: The software name used to make this image.
Notes:
The data for this property is stored in the Tiff file.
(Read and Write property)
TiffPictureMBS.Version as Integer
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 5.0, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: The version of the Tiff library used.
Notes:
Updated to 3.7.1 in plugin version 5.0.
(Read only property)
TiffPictureMBS.VersionString as String
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 5.0, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: The version of the Tiff library used.
Notes:
Updated to 3.7.1 in plugin version 5.0.
(VersionString was named Version in v4)
(Read only property)
TiffPictureMBS.VerticalPosition as Single
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: The y Offset of this image in the drawing area.
Notes:
The data for this property is stored in the Tiff file.
(Read and Write property)
TiffPictureMBS.VerticalResolution as Single
property, Pictures Import and Export, MBS Tiff Plugin (Tiff), class TiffPictureMBS, Plugin version: 4.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.

Function: The vertical resolution used.
Notes:
Value depends on ResolutionUnit value.

The data for this property is stored in the Tiff file.
(Read and Write property)

Previous items

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