Fl_PNG_Image Class Reference

The Fl_PNG_Image class supports loading, caching, and drawing of Portable Network Graphics (PNG) image files. More...

#include <Fl_PNG_Image.H>

Inheritance diagram for Fl_PNG_Image:
Fl_RGB_Image Fl_Image

List of all members.

Public Member Functions

 Fl_PNG_Image (const char *name_png, const unsigned char *buffer, int datasize)
 Constructor that reads a PNG image from memory.
 Fl_PNG_Image (const char *filename)
 The constructor loads the named PNG image from the given png filename.

Detailed Description

The Fl_PNG_Image class supports loading, caching, and drawing of Portable Network Graphics (PNG) image files.

The class loads colormapped and full-color images and handles color- and alpha-based transparency.


Constructor & Destructor Documentation

Fl_PNG_Image::Fl_PNG_Image ( const char *  filename  ) 

The constructor loads the named PNG image from the given png filename.

The destructor frees all memory and server resources that are used by the image.

Use Fl_Image::fail() to check if Fl_PNG_Image failed to load. fail() returns ERR_FILE_ACCESS if the file could not be opened or read, ERR_FORMAT if the PNG format could not be decoded, and ERR_NO_IMAGE if the image could not be loaded for another reason.

Parameters:
[in] filename Name of PNG file to read
Fl_PNG_Image::Fl_PNG_Image ( const char *  name_png,
const unsigned char *  buffer,
int  maxsize 
)

Constructor that reads a PNG image from memory.

Construct an image from a block of memory inside the application. Fluid offers "binary Data" chunks as a great way to add image data into the C++ source code. name_png can be NULL. If a name is given, the image is added to the list of shared images (see: Fl_Shared_Image) and will be available by that name.

Parameters:
name_png A name given to this image or NULL
buffer Pointer to the start of the PNG image in memory
maxsize Size in bytes of the memory buffer containing the PNG image

The documentation for this class was generated from the following files: