Platforms to show: All Mac Windows Linux Cross-Platform
Back to TiffPictureMBS class.
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 | iOS | Targets |
| method | TIFF | MBS Images Plugin | 8.7 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See tiff documentation for details.
Some examples using this method:
TiffPictureMBS.AddImage as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 5.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
Calls TIFFWriteDirectory internally.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 3.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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.
TiffPictureMBS.CombinePictureWithMask as picture
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 6.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
TiffPictureMBS.Create(file as folderitem) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success.
See also:
TiffPictureMBS.Create(file as folderitem, endian as Integer) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success.
Endian settings:
| 0 | Default (System) |
| 1 | BigEndian (Mac) |
| 2 | LittleEndian (Win) |
See also:
TiffPictureMBS.Create(Path as String, endian as integer = 0) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 19.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success.
Endian settings:
| 0 | Default (System) |
| 1 | BigEndian (Mac) |
| 2 | LittleEndian (Win) |
See also:
TiffPictureMBS.CreateString(Size as Integer) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 5.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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:
Some examples using this method:
TiffPictureMBS.CreateString(Size as Integer, Mode as string) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 5.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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:
TiffPictureMBS.Flush as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 5.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
In normal operation this call is never needed - the library automatically does any flushing required.
TiffPictureMBS.FlushData as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 5.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
In normal operation this call is never needed Å| the library automatically does any flushing required.
TiffPictureMBS.ImageCount as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns 0 on any error.
TiffPictureMBS.ImageIndex as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
0 based.
TiffPictureMBS.IsLastImage as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Useful if you walk through all pictures using NextImage.
TiffPictureMBS.MirrorVertical(output as TiffPictureMBS) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 7.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
You may be able to pass the current tiff file as the output one if you have it open for read and write.
Returns true on success and false on failure.
Works for any color depth or color mode.
TiffPictureMBS.NextImage as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success and false on any error.
See also:
TiffPictureMBS.NextImage(HeaderOnly as boolean) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If HeaderOnly is false the current picture is read into the pict&mask properties.
See also:
TiffPictureMBS.Open(file as folderitem) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
You need to use the ReadRGB method or the Scanline property to get data from this file.
Returns true on success.
See also:
TiffPictureMBS.Open(file as folderitem, Mode as string) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 5.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as the other Open method, but you can pass a mode string to the library.
The open mode parameter can include the following flags in addition to the "r" (Read), "w" (Write), and "a" (Append) flags. Note however that option flags must follow the read-write-append specification.
| l | When creating a new file force information be written with Little-Endian byte order (but see below). By default the library will create new files using the native CPU byte order. |
| b | When creating a new file force information be written with Big-Endian byte order (but see below). By default the library will create new files using the native CPU byte order. |
| L | Force image data that is read or written to be treated with bits filled from Least Significant Bit (LSB) to Most Significant Bit (MSB). Note that this is the opposite to the way the library has worked from its inception. |
| B | Force image data that is read or written to be treated with bits filled from Most Significant Bit (MSB) to Least Significant Bit (LSB); this is the default. |
| H | Force image data that is read or written to be treated with bits filled in the same order as the native CPU. |
| M | Enable the use of memory-mapped files for images opened read-only. If the underlying system does not support memory-mapped files or if the specific image being opened cannot be memory-mapped then the library will fallback to using the normal system interface for reading information. By default the library will attempt to use memory-mapped files. |
| m | Disable the use of memory-mapped files. |
| C | Enable the use of "strip chopping" when reading images that are comprised of a single strip or tile of uncompressed data. Strip chopping is a mechanism by which the library will automatically convert the single-strip image to multiple strips, each of which has about 8 Kilobytes of data. This facility can be useful in reducing the amount of memory used to read an image because the library normally reads each strip in its entirety. Strip chopping does however alter the apparent contents of the image because when an image is divided into multiple strips it looks as though the underlying file contains multiple separate strips. Finally, note that default handling of strip chopping is a compile-time configuration parameter. The default behaviour, for backwards compatibility, is to enable strip chopping. |
| c | Disable the use of strip chopping when reading images. |
See also:
TiffPictureMBS.Open(Path as String, Mode as string) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 19.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as the other Open method, but you can pass a mode and path as string to the library.
The open mode parameter can include the following flags in addition to the "r" (Read), "w" (Write), and "a" (Append) flags. Note however that option flags must follow the read-write-append specification.
| l | When creating a new file force information be written with Little-Endian byte order (but see below). By default the library will create new files using the native CPU byte order. |
| b | When creating a new file force information be written with Big-Endian byte order (but see below). By default the library will create new files using the native CPU byte order. |
| L | Force image data that is read or written to be treated with bits filled from Least Significant Bit (LSB) to Most Significant Bit (MSB). Note that this is the opposite to the way the library has worked from its inception. |
| B | Force image data that is read or written to be treated with bits filled from Most Significant Bit (MSB) to Least Significant Bit (LSB); this is the default. |
| H | Force image data that is read or written to be treated with bits filled in the same order as the native CPU. |
| M | Enable the use of memory-mapped files for images opened read-only. If the underlying system does not support memory-mapped files or if the specific image being opened cannot be memory-mapped then the library will fallback to using the normal system interface for reading information. By default the library will attempt to use memory-mapped files. |
| m | Disable the use of memory-mapped files. |
| C | Enable the use of "strip chopping" when reading images that are comprised of a single strip or tile of uncompressed data. Strip chopping is a mechanism by which the library will automatically convert the single-strip image to multiple strips, each of which has about 8 Kilobytes of data. This facility can be useful in reducing the amount of memory used to read an image because the library normally reads each strip in its entirety. Strip chopping does however alter the apparent contents of the image because when an image is divided into multiple strips it looks as though the underlying file contains multiple separate strips. Finally, note that default handling of strip chopping is a compile-time configuration parameter. The default behaviour, for backwards compatibility, is to enable strip chopping. |
| c | Disable the use of strip chopping when reading images. |
See also:
TiffPictureMBS.OpenString(data as string) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 5.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as the Open() function, but memory based. You can now use functions like Scanline(), ReadSW() or ReadRGB() to get the picture data.
Returns true on success.
The Warning and Error events may show you reasons why it does not work.
The string you pass is saved in the data property of the class for later use.
You can and should use this function to write yourself a TiffStringToPicture function.
See also:
TiffPictureMBS.OpenString(data as string, Mode as string) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 5.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as the other OpenString method, but you can pass a mode string to the library.
See also:
TiffPictureMBS.VStripSize(nrows as UInt32) as UInt64
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
TiffPictureMBS.VTileSize(nrows as UInt32) as UInt64
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
TiffPictureMBS.WriteBW as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 5.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Uses the pictures in the pict property to write a picture.
Currently masks are not supported.
The following settings are made before the image data is written:
PlanarConfig = PLANARCONFIG_CONTIG
Photometric = PHOTOMETRIC_MINISBLACK
BitsPerSample = 1
SamplesPerPixel = 1
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:
TiffPictureMBS.WriteEncodedStrip(strip as UInt32, data as Memoryblock, size as Integer = 0) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Compress size bytes of raw data from buf and write the result to the specified strip; replacing any previously written data. Note that the value of strip is a ‘‘raw strip number.'' That is, the caller must take into account whether or not the data are organized in separate planes (PlanarConfiguration=2).
The library writes encoded data using the native machine byte order. Correctly implemented TIFF readers are expected to do any necessary byte-swapping to correctly process image data with BitsPerSample greater than 8.
The strip number must be valid according to the current settings of the ImageLength and RowsPerStrip tags. An image may be dynamically grown by increasing the value of ImageLength prior to each call to WriteEncodedStrip.
Returns −1 is returned if an error was encountered. Otherwise, the value of size is returned.
If size is zero, we use the size of memoryblock.
TiffPictureMBS.WriteEncodedTile(tile as UInt32, data as Memoryblock, size as Integer = 0) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | TIFF | MBS Images Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Compress size bytes of raw data from buf and append the result to the end of the specified tile. Note that the value of tile is a "raw tile number". That is, the caller must take into account whether or not the data are organized in separate places (PlanarConfiguration=2). ComputeTile automatically does this when converting an (x,y,z,sample) coordinate quadruple to a tile number.
The library writes encoded data using the native machine byte order. Correctly implemented TIFF readers are expected to do any necessary byte-swapping to correctly process image data with BitsPerSample greater than 8.
Returns −1 is returned if an error was encountered. Otherwise, the value of size is returned.
If size is zero, we use the size of memoryblock.
The items on this page are in the following plugins: MBS Images Plugin.