Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Previous items

TiffPictureMBS.Scanline(mem as Ptr, index as Integer, sample as Integer = 0) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 11.0 Yes Yes Yes Yes No
Function: Reads an image scanline in a memoryblock.
Notes:
Returns false on any error.
Thee Memoryblock must be big enough. The BytesPerRow functions returns the number of bytes needed.
The first scanline has the index of 0.
This is the fastest way to read scanlines. You provide the memoryblock and you can reuse it for all calls to this method for one tiff.

See also:

Feedback, Comments & Corrections

TiffPictureMBS.Scanlines(index as Integer, count as Integer, sample as Integer = 0, lineStepScanlines as Integer = 1, lineStepReturn as Integer = 1) as memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property TIFF MBS Images Plugin 4.3 Yes Yes Yes Yes No
Function: Serveral image scanlines.
Notes:
Returns nil on any error.
If you set the value, make sure the Memoryblock is big enough. 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.

If lineStepScanlines is >1, we skip scan lines so we read less data.
If lineStepReturn is >1, we return only every nth row.

If rows can be read with skipping, you should try lineStepScanlines = 2 or more for skipping lines.
If that doesn't work due to tiled data, you can use lineStepReturn = 2 or more.
This skipping is to quicker get preview pictures.
(Read and Write computed property)

Feedback, Comments & Corrections

TiffPictureMBS.SetColorMap(red as memoryblock, green as memoryblock, 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: Sets 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.SetColorProfile(ProfileData as String) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 7.2 Yes Yes Yes Yes No
Function: Sets the color profile for this tiff file.
Notes: Returns true on success and false on failure.

Feedback, Comments & Corrections

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

Feedback, Comments & Corrections

TiffPictureMBS.SetFieldByte(Tag as Integer, 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: 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.

Feedback, Comments & Corrections

TiffPictureMBS.SetFieldDouble(Tag as Integer, 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: 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.

Feedback, Comments & Corrections

TiffPictureMBS.SetFieldInteger(Tag as Integer, 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: 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.

Feedback, Comments & Corrections

TiffPictureMBS.SetFieldMemory(Tag as Integer, ItemCount as Integer, data 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: 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.

Feedback, Comments & Corrections

TiffPictureMBS.SetFieldShort(Tag as Integer, 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: 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.

Feedback, Comments & Corrections

TiffPictureMBS.SetFieldSingle(Tag as Integer, 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: 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.

Feedback, Comments & Corrections

TiffPictureMBS.SetFieldString(Tag as Integer, 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: 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=SpecialFolder.Desktop.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.

Feedback, Comments & Corrections

TiffPictureMBS.SetImageIndex(index as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 4.3 Yes Yes Yes Yes No
Function: Sets the current image index and reads the new image.
Example:
dim t as TiffPictureMBS // your tiff picture

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.
Index is zero based.

See also:

Feedback, Comments & Corrections

TiffPictureMBS.SetImageIndex(index as Integer, HeaderOnly as boolean) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 4.3 Yes Yes Yes Yes No
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.

See also:

Feedback, Comments & Corrections

TiffPictureMBS.SetXMP(ProfileData as String) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 7.3 Yes Yes Yes Yes No
Function: Sets the xmp metadata package for this tiff file.
Notes: Returns true on success and false on failure.

Feedback, Comments & Corrections

TiffPictureMBS.VStripSize(nrows as UInt32) as UInt64
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 13.5 Yes Yes Yes Yes No
Function: Returns the number of bytes in a strip with nrows rows of data.

Feedback, Comments & Corrections

TiffPictureMBS.VTileSize(nrows as UInt32) as UInt64
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 13.5 Yes Yes Yes Yes No
Function: Returns the number of bytes in a row-aligned tile with nrows of data.

Feedback, Comments & Corrections

TiffPictureMBS.WriteBW 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: Write a black & white image.
Example:
dim p as Picture
dim f as FolderItem
dim t as TiffPictureMBS

p=NewPicture(100,100,32)
p.Graphics.ForeColor=rgb(0,0,0)
p.Graphics.FillOval 0,0,100,100

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

t=new TiffPictureMBS

if t.Create(f) then
t.Pict=p
if t.WriteBW then
MsgBox "ok"
end if
end if

Backdrop=p
Notes:
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.

Feedback, Comments & Corrections

TiffPictureMBS.WriteEncodedStrip(strip as UInt32, data as Memoryblock, size as Integer = 0) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 13.5 Yes Yes Yes Yes No
Function: Compress and write a strip of data to an open TIFF file.
Notes:
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.

Feedback, Comments & Corrections

TiffPictureMBS.WriteEncodedTile(tile as UInt32, data as Memoryblock, size as Integer = 0) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 13.5 Yes Yes Yes Yes No
Function: Compress and write a tile of data to an open TIFF file.
Notes:
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.

Feedback, Comments & Corrections

TiffPictureMBS.WriteGray as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 7.5 Yes Yes Yes Yes No
Function: Write a grayscale image with 256 colors.
Example:
dim t as TiffPictureMBS
dim f as FolderItem

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

t=new TiffPictureMBS
if t.Create(f) then
t.Pict=LogoMBS(500)
call t.WriteGray
t.Close
end if
Notes:
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 = 8
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.
Version 13.1 of our plugins writes a 16 bit Gray image if you set BitsPerSample to 16 before calling this method.

Feedback, Comments & Corrections

TiffPictureMBS.WriteRawStrip(strip as UInt32, data as Memoryblock, size as Integer = 0) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 13.5 Yes Yes Yes Yes No
Function: Write a strip of raw data to an open TIFF file.
Notes:
Append size bytes of raw data to the specified strip.

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 WriteRawStrip.

Returns -1 is returned if an error occurred. Otherwise, the value of size is returned.

If size is zero, we use the size of memoryblock.

Feedback, Comments & Corrections

TiffPictureMBS.WriteRawTile(tile as UInt32, data as Memoryblock, size as Integer = 0) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method TIFF MBS Images Plugin 13.5 Yes Yes Yes Yes No
Function: Write a tile of raw data to an open TIFF file
Notes:
Append size bytes of raw data to the specified tile.
Returns −1 is returned if an error occurred. Otherwise, the value of size is returned.
If size is zero, we use the size of memoryblock.

Feedback, Comments & Corrections

TiffPictureMBS.WriteRGB 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: Writes a RGB image.
Example:
dim m,p as Picture
dim f as FolderItem
dim t as TiffPictureMBS
dim g as Graphics

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

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
Notes:
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.

Feedback, Comments & Corrections

Previous items

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





Links
MBS Xojo Plugins