GraphicsFormats Xojo Plugin for Console targets

PngImporterConsole.GetInfoFromStream Method (console only)

Reads image size and metadata from PNG stream without reading the whole image.

GetInfoFromStream(
   stream as IBinaryStreamReader,
   width as Integer,
   height as Integer) as Boolean

Parameters

stream
The stream containing the PNG data to import image info from.
width
ByRef parameter that returns the width of the image. This parameter is left untouched if the function returns false.
height
ByRef parameter that returns the height of the image. This parameter is left untouched if the function returns false.

Returns

Boolean
Returns true if it was successful reading size and metadata, else false in which case the file is probably invalid png file.

Remarks

Width and Height are returned in the ByRef parameter of this function. Other metadata will be available on the class properties if the function returns true and if the png image contained some of the meta data properties.

See Also

PngImporterConsole Class