readPng
const func PRIMITIVE_WINDOW: readPng (inout file: pngFile)
-
Reads a PNG file into a pixmap.
- Parameters:
- pngFile - File that contains a PNG image.
- Returns:
- A pixmap with the PNG image, or PRIMITIVE_WINDOW.value if the file does not contain a PNG magic number.
- Raises:
- RANGE_ERROR - The file is not in the PNG file format.
readPng
const func PRIMITIVE_WINDOW: readPng (in string: pngFileName)
-
Reads a PNG file with the given pngFileName into a pixmap.
- Parameters:
- pngFileName - Name of the PNG file.
- Returns:
- A pixmap with the PNG image, or PRIMITIVE_WINDOW.value if the file cannot be opened or does not contain a PNG magic number.
- Raises:
- RANGE_ERROR - The file is not in the PNG file format.
str
const func string: str (in PRIMITIVE_WINDOW: pixmap, PNG)
-
Converts a pixmap into a string in PNG format.
- Parameters:
- pixmap - Pixmap to be converted.
- Returns:
- A string with data in PNG format.
writePng
const proc: writePng (in string: pngFileName, in PRIMITIVE_WINDOW: pixmap)
-
Writes the pixmap to the file with the given pngFileName in PNG format.
- Parameters:
- pngFileName - Name of the PNG file to be created.
- pixmap - The pixmap to be written in PNG format.