GraphicsFormats Xojo plugin

PngImporter.GetInfoFromStream Method

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

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

Parameters

stream
The stream containing the PNG data to import image info from.
width (ByRef parameter)
ByRef parameter that returns the width of the image. This parameter is left untouched if the function returns false.
height (ByRef parameter)
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

PngImporter Class