PxLoadImage

PxLoadImage — loads image files.

Syntax

PxLoadImage (filename)

		

Arguments

filename

A string containing a path to a valid image file.

Returns

The image, as an instance of PhImage.

Description

This function loads .BMP, .JPG, and .GIF files and returns the image file.

Example

This example, ex_PxLoadImage.g, is included in the product distribution.

#!/usr/cogent/bin/phgamma

/*
The following program creates a new window with a label.  The label
type is changed from text (default) to image and a pre_loaded picture
is put into the label.
*/

PtInit(nil);

win = new(PtWindow);

pic = PxLoadImage("smiley.bmp");

lab = new(PtLabel);
lab.label_type = Pt_IMAGE;
lab.label_data = pic;

PtRealizeWidget(win);
PtMainLoop();

See Also

PxReduceImage

and in Photon documentation: PxLoadImage.