Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

TiffPictureMBS.AddCustomTag(Tag as Integer, FieldReadCount as Integer, FieldWriteCount as Integer, FieldType as Integer, FieldBit as Integer, OkToChange as Integer, PassCount as Integer, FieldName as string) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: Adds a custom tag.
Example:
const TIFFTAG_ASCIITAG = 40666
const TIFFTAG_LONGTAG = 40667
const TIFFTAG_SHORTTAG = 40668
const TIFFTAG_RATIONALTAG = 40669
const TIFFTAG_FLOATTAG = 40670
const TIFFTAG_DOUBLETAG = 40671
const TIFFTAG_BYTE = 40672

const TIFFTAG_SOFTWARE=305

const TIFF_BYTE=1
const TIFF_ASCII=2
const TIFF_SHORT=3 // integer 16 bit signed
const TIFF_LONG=4 // integer 32 bit
const TIFF_FLOAT=11
const TIFF_DOUBLE=12

const FIELD_CUSTOM = 65

dim t as new TiffPictureMBS

// open tiff

if not t.AddCustomTag(TIFFTAG_ASCIITAG, -1, -1, TIFF_ASCII, FIELD_CUSTOM, 1, 0, "MyString") then
MsgBox "AddCustomTag failed1."
end if
Notes: See tiff documentation for details.

Feedback, Comments & Corrections

TiffPictureMBS.AddImage as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 5.4 Yes Yes Yes Yes No
Function: Writes existing picture and header information to file and starts a new one.
Example:
dim t as TiffPictureMBS
dim f as FolderItem
dim p as Picture

f=SpecialFolder.Desktop.Child("test.tif")
t=new TiffPictureMBS
if t.Create(f) then

p=NewPicture(100,100,32)
p.Graphics.ForeColor=rgb(255,0,0)
p.Graphics.FillOval 0,0,100,100
t.Pict=p
if t.WriteRGB then
if t.AddImage then
p=NewPicture(100,100,32)
p.Graphics.ForeColor=rgb(0,0,255)
p.Graphics.FillOval 0,0,100,100
t.Pict=p
if t.WriteRGB then
MsgBox "Written multi picture tiff."
end if
end if
end if
end if
Notes:
Returns true on success and false on any error.

Calls TIFFWriteDirectory internally.

Feedback, Comments & Corrections

TiffPictureMBS.close
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 3.4 Yes Yes Yes Yes No
Function: Closes the Tiff handle.
Notes:
In 5.1 and older the destructor.
In 5.2 and later only closes the tiff handle so you can still read the pictures, the output or input buffer.

Feedback, Comments & Corrections

TiffPictureMBS.CombinePictureWithMask as picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 6.4 Yes Yes Yes Yes No
Function: Returns a new picture which is created using the picture and it's mask.
Example:
dim t as TiffPictureMBS
' ...
canvas1.backdrop=t.CombinePictureWithMask

Feedback, Comments & Corrections

TiffPictureMBS.Create(file as folderitem) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 4.2 Yes Yes Yes Yes No
Function: Creates a new empty tiff file.
Example:
dim p as Picture
dim f as FolderItem
dim t as TiffPictureMBS

p=NewPicture(100,100,32)

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

t=new TiffPictureMBS
t.Pict=p

if t.Create(f) then
if t.WriteRGB then
t.Close
MsgBox "Ok"
f.Launch
end if
end if
Notes:
Returns true on success.

This function uses paths like all Tiff functions, so be sure there are not two volumes named equal on a Mac OS Classic system.

See also:

Feedback, Comments & Corrections

TiffPictureMBS.Create(file as folderitem, endian as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 4.2 Yes Yes Yes Yes No
Function: Creates a new empty tiff file.
Notes:
Returns true on success.

Endian settings:
0Default (System)
1BigEndian (Mac)
2LittleEndian (Win)

This function uses paths like all Tiff functions, so be sure there are not two volumes named equal on a Mac OS Classic system.

See also:

Feedback, Comments & Corrections

TiffPictureMBS.CreateString(Size as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 5.2 Yes Yes Yes Yes No
Function: Creates a new string based tiff writer.
Example:
Function PictureToTiffStringMBS(pic as picture) As string
dim t as TiffPictureMBS

t=new TiffPictureMBS
if t.CreateString(&h100000) then
t.Pict=pic
if t.WriteRGB then
t.Close
Return t.OutputBuffer
end if
end if
End Function
Notes:
Same as the Create() function, but memory based. You can now use functions like Scanline(), WriteSW() or WriteRGB() to put the picture data.

Returns true on success.
The Warning and Error events may show you reasons why it does not work.

The size parameter you pass in is a guess for the initial size of the memory block used. If more data is written, the memory block is resized, but it is quite slow to resize a memoryblock, so make a good guess!

You can and should use this function to write yourself a PictureToTiffString function. The plugin can not well make such a function as there are thousands of possible parameters combination you may want to use. (compared to the JPEG library where you only have the compression level parameter.)

See also:

Feedback, Comments & Corrections

TiffPictureMBS.CreateString(Size as Integer, Mode as string) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 5.3 Yes Yes Yes Yes No
Function: Creates a new string based tiff writer.
Notes:
Same as the other CreateString method, but you can pass a mode string to the library.

mode="wb" for big endian and mode="wl" for little endian.

See also:

Feedback, Comments & Corrections

TiffPictureMBS.Flush as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 5.4 Yes Yes Yes Yes No
Function: Flush causes any pending writes for the specified file (including writes for the current directory) to be done.
Notes: In normal operation this call is never needed - the library automatically does any flushing required.

Feedback, Comments & Corrections

TiffPictureMBS.FlushData as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 5.4 Yes Yes Yes Yes No
Function: FlushData flushes any pending image data for the specified file to be written out; directory-related data are not flushed.
Notes: In normal operation this call is never needed Å| the library automatically does any flushing required.

Feedback, Comments & Corrections

TiffPictureMBS.GetColorMap(byref red as memoryblock, byref green as memoryblock, byref blue as memoryblock) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 9.6 Yes Yes Yes Yes No
Function: Queries the color map for a paletten image.
Notes:
The memoryblock must be 2^bitspersample * 2 bytes big.
Returns true on success and false on failure.

Feedback, Comments & Corrections

TiffPictureMBS.GetColorProfile as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 7.2 Yes Yes Yes Yes No
Function: Returns the color profile data stored in the tiff file.
Example:
dim f as FolderItem
dim t as TiffPictureMBS
dim s as string
dim p as LCMS2ProfileMBS

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

t=f.OpenAsTiffMBS

s=t.GetColorProfile

p = LCMS2ProfileMBS.OpenProfileFromString(s)

MsgBox p.Name
Notes: Returns "" on any error.

Feedback, Comments & Corrections

TiffPictureMBS.GetData(Tag as Integer) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 8.5 Yes Yes Yes Yes No
Function: Reads the string stored for this tag.

Feedback, Comments & Corrections

TiffPictureMBS.GetField(Tag as Integer, mem as memoryblock) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 7.0 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
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.
The memoryblock you pass in must be big enough to hold whatever data the library stores there.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldByte(Tag as Integer, byref value as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
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.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldCount(Tag as Integer, byref count as Integer, mem as memoryblock) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
Example:
'TIFF Tag ImageID
'
'IFD Image
'Code 32781 (hex 0x800D)
'Name ImageID
'Type ASCII
'Count N
'Default None
'Description
'
'OPI-related.
'
'ImageID is the full pathname of the original, high-resolution image, or any other identifying string that uniquely identifies the original image.
'
'The high-resolution image is not required to be in TIFF format. It can be in any format that an OPI Consumer wishes to support.

DIm tiffImport As TiffPictureMBS
Dim xx as string

tiffImport = New TiffPictureMBS
Call tiffImport.Open(SpecialFolder.Desktop.Child("test.tif"))

// the memoryblock is a storage for the data. In this case a pointer to the CString
dim m as MemoryBlock=NewMemoryBlock(4)
dim count as Integer

if tiffImport.GetFieldCount(32781, count, m) then
MsgBox str(count)
MsgBox m.Ptr(0).CString(0)
end if

tiffImport.close
Notes:
This is the special version using memoryblock so you can use it for reading values with a count value.

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.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldDefaultedByte(Tag as Integer, byref value as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
Notes:
Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.

GetFieldDefaulted* is identical to GetField*, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldDefaultedDouble(Tag as Integer, byref value as Double) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 7.0 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
Notes:
Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.

GetFieldDefaulted* is identical to GetField*, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldDefaultedInteger(Tag as Integer, byref value as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 7.0 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
Notes:
Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.

GetFieldDefaulted* is identical to GetField*, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldDefaultedShort(Tag as Integer, byref value as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 7.0 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
Notes:
Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.

GetFieldDefaulted* is identical to GetField*, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldDefaultedSingle(Tag as Integer, byref value as Single) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
Notes:
Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.

GetFieldDefaulted* is identical to GetField*, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldDefaultedString(Tag as Integer, byref value as String) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 8.4 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
Example:
dim t as TiffPictureMBS
dim f as FolderItem
dim s as string

f=SpecialFolder.Desktop.Child("ChristianSchmitz.tif")
t=f.OpenAsTiffMBS

const TIFFTAG_SOFTWARE=305

if t.GetFieldDefaultedString(TIFFTAG_SOFTWARE, s) then
MsgBox "TIFFTAG_SOFTWARE"+EndOfLine+s
end if
Notes:
Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.
The string is returned with ascii encoding. You may need to define a different encoding is this is not correct.

GetFieldDefaulted* is identical to GetField*, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldDouble(Tag as Integer, byref value as Double) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 7.0 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
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.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldInteger(Tag as Integer, byref value as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 7.0 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
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.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldMemory(Tag as Integer, byref ItemCount as Integer) as memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
Notes:
This is the special version using memoryblock so you can use it for reading values with a count value.

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.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldShort(Tag as Integer, byref value as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 7.0 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
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.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldSingle(Tag as Integer, byref value as Single) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
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.

Feedback, Comments & Corrections

TiffPictureMBS.GetFieldString(Tag as Integer, byref value as string) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 8.4 Yes Yes Yes Yes No
Function: Reads the value associated with the given tag id.
Example:
dim t as TiffPictureMBS
dim f as FolderItem
dim s as string

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

const TIFFTAG_SOFTWARE=305

if t.GetFieldString(TIFFTAG_SOFTWARE, s) then
MsgBox "TIFFTAG_SOFTWARE"+EndOfLine+s
end if

const TIFFTAG_HOSTCOMPUTER=316

if t.GetFieldString(TIFFTAG_HOSTCOMPUTER, s) then
MsgBox "TIFFTAG_SOFTWARE"+EndOfLine+s
end if

const TIFFTAG_IMAGEDESCRIPTION=270

if t.GetFieldString(TIFFTAG_IMAGEDESCRIPTION, s) then
MsgBox "TIFFTAG_IMAGEDESCRIPTION"+EndOfLine+s
end if

const TIFFTAG_MAKE=271

if t.GetFieldString(TIFFTAG_MAKE, s) then
MsgBox "TIFFTAG_MAKE"+EndOfLine+s
end if

const TIFFTAG_ARTIST=315

if t.GetFieldString(TIFFTAG_ARTIST, s) then
MsgBox "TIFFTAG_ARTIST"+EndOfLine+s
end if
Notes:
Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.
The string is returned with ascii encoding. You may need to define a different encoding is this is not correct.

Feedback, Comments & Corrections

TiffPictureMBS.GetXMP as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 7.3 Yes Yes Yes Yes No
Function: Returns the xmp metadata package stored in the tiff file.
Example:
dim f as FolderItem
dim t as TiffPictureMBS
dim s as string

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

t=f.OpenAsTiffMBS

s=t.GetXMP

MsgBox left(s,500)
Notes: Returns "" on any error.

Feedback, Comments & Corrections

Next items

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





Links
MBS FileMaker blog