PxLoadImage

Gamma/Photon: Using Gamma™ with the Photon microGUIŽ, Version 4.0
Prev |  | Next

# `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 `gamma_ph_`#`_examples_1_QNX4.tgz` file available on the Cogent Web Site.

    #!/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.

Prev | Home | Next
`PxGreyImage` | Up | `PxReduceImage`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.