Platforms to show: All Mac Windows Linux Cross-Platform

PNGReaderMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class PNG MBS Images Plugin 9.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The class for reading PNG files.
Example
Var Current as PictureMBS // global
Var f as FolderItem

f=GetopenFolderItem(FileTypes.Png)

if f<>Nil then
Current=nil

Var p as new PNGReaderMBS

if p.OpenFile(f) then
if p.ApplyOptions(0) then

Current=new PictureMBS(p.Width,p.Height,PictureMBS.ImageFormatRGB)

Var i,c as Integer

c=p.Height-1
for i=0 to c
Current.RowInFormat(i, PictureMBS.ImageFormatRGBA)=p.ReadRow
next

end if
end if
end if

Use this class to read PNG files row by row as memoryblock.

Based on LibPNG.

This class has no sub classes.

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Release notes

  • Version 20.4
    • Fixed bug in error handling for ApplyOptions in PNGReaderMBS class.
  • Version 20.2
    • Added CompressionBufferSize, UserWidthMaximum, UserHeightMaximum, ChunkCacheMax, and ChunkMallocMax properties to PNGReaderMBS class.
    • Deprecated OpenSpecialData method in PNGReaderMBS class.
  • Version 19.5
    • Added ExpandGrayToRGB and StripAlpha properties to PNGReaderMBS class.
    • Added InvertAlpha property to PNGReaderMBS class.
    • Added OriginalColorType property to PNGReaderMBS class.
    • Added path variant for OpenFile method and new SourcePath property to PNGReaderMBS class.
    • Added RGBToGray, RGBToGrayErrorAction, RGBToGrayGreen, RGBToGrayRed properties to PNGReaderMBS class.
    • Added UseFiller property to PNGReaderMBS class.
  • Version 19.2
  • Version 19.0

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


PNGpictureMBS   -   PNGWriterMBS


The biggest plugin in space...