Platforms to show: All Mac Windows Linux Cross-Platform
Back to PNGWriterMBS class.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns "" on any error.
PNGWriterMBS.OpenWriteDestination(file as folderitem) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If you pass nil for the file, the data is collected in memory and you can get it on the end using the Finish method.
See also:
Some examples using this method:
PNGWriterMBS.OpenWriteDestination(Path as String) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 19.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If you pass "" for the file, the data is collected in memory and you can get it on the end using the Finish method.
See also:
PNGWriterMBS.SetAlphaData(alphas() as Integer, colors() as color) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The array can have up to 256 colors.
The color and the alpha arrays must have the same size.
Returns true on success.
PNGWriterMBS.SetAlphas as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
You must call SetAlphaData before.
Returns true on success.
PNGWriterMBS.SetEXIF(EXIFData as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 19.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success or false on failure.
PNGWriterMBS.SetGamma(gamma as Double = 0.0) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns on success.
The gamma parameter defines what gamma correction is applied:
positive value: use the value as the gamma correction
zero: use default value (or value saved in file itself)
negative value: do not correct gamma
Default for Mac is 1.8 and for Windows 2.2.
If you use SRGB, the Gamma must be 2.2.
PNGWriterMBS.SetGrayPicture(pict as picture, mask as picture = nil) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 12.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method sets width, height, type and bpc properties.
Returns true on success.
Mask can be nil.
Some examples using this method:
PNGWriterMBS.SetHeader(Interlace as boolean = false, Filter as Integer = -1, Compression as Integer = -1) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Interlace is true the Adam7 interlacing is used.
FilterType specifies the filter:
const PNG_NO_FILTERS | = 0 |
const PNG_FILTER_NONE | = 8 |
const PNG_FILTER_SUB | = 16 |
const PNG_FILTER_UP | = 32 |
const PNG_FILTER_AVG | = 64 |
const PNG_FILTER_PAETH | = 128 |
const PNG_FILTER_ALL | = 248 |
Compression can be between 0 (none) to 9 (max). Default is 6. Value -1 means the plugin will not change from default of PNG library. Normally you have no better compression for setting higher than 6, but only burn more CPU power.
PNGWriterMBS.SetICCProfile(name as string, CompressionType as Integer, Profile as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Name is the profile name as an ASCII string.
CompressionType is always 0 (PNG_COMPRESSION_TYPE_BASE).
Some examples using this method:
PNGWriterMBS.SetPalette as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success.
PNGWriterMBS.SetPaletteData(colors() as color) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The array can have up to 256 colors.
Returns true on success.
PNGWriterMBS.SetPalettePicture(pict as picture) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
You need to define the color palette before calling this method.
This method sets width, height, type and bpc properties.
Returns true on success.
PNGWriterMBS.SetResolution(ResolutionHorizontal as Integer, ResolutionVertical as Integer, Unit as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 10.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Unit is ResolutionUnknown, ResolutionMeter or ResolutionDPI.
Internally the PNG saves only in dots per meter, so the plugin converts DPI to DPM for you.
PNGWriterMBS.SetRGBPicture(pict as picture, mask as picture = nil) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method sets width, height, type and bpc properties.
Returns true on success.
Mask can be nil.
Some examples using this method:
PNGWriterMBS.SetRows(rows() as memoryblock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 12.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The memory is not copied, so keep the array alive!
This method sets height. You need to set width, bpc, type and rowbytes.
Returns true on success.
Some examples using this method:
PNGWriterMBS.SetsRGB(intent as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Possible values:
const PNG_sRGB_INTENT_PERCEPTUAL | = 0 |
const PNG_sRGB_INTENT_RELATIVE | = 1 |
const PNG_sRGB_INTENT_SATURATION | = 2 |
const PNG_sRGB_INTENT_ABSOLUTE | = 3 |
Some examples using this method:
PNGWriterMBS.WriteEnd as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success.
Do not call if you use WriteRows.
Some examples using this method:
PNGWriterMBS.WriteInfo as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns true on success.
Do not call if you use WriteRows.
Some examples using this method:
PNGWriterMBS.WriteRow(row as memoryblock)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The data must be in the RGBA format with one byte per value.
(4 bytes per Pixel)
Returns true on success.
Do not call if you use WriteRows.
Some examples using this method:
PNGWriterMBS.WriteRows as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PNG | MBS Images Plugin | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If you call this method, you need to call SetRGBPicture or SetPalettePicture before and you can't call WriteInfo, WriteRow and WriteEnd.
Some examples using this method:
The items on this page are in the following plugins: MBS Images Plugin.