ImageToLabel

ImageToLabel — makes a label from an image.

Syntax

ImageToLabel (image)

		

Arguments

image

The image of which to make a label.

Returns

An image label on success, otherwise nil.

Description

This function creates a label, strips off its borders, converts it to an image label, and applies the passed image to it.

To use this function, you must load the ImageProc.lsp library with a call to require_lisp("ImageProc.lsp").

Example

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

#!/usr/cogent/bin/phgamma

//This example puts up a window with an image label in it.

PtInit(nil);
require_lisp("PhotonWidgets.lsp");
require_lisp("ImageProc.lsp");

win = new(PtWindow);
win.SetDim(140,140);

img = PxLoadImage("smiley.bmp");
lab = ImageToLabel(img);
lab.SetPos(25,25);

PtRealizeWidget(win);
PtMainLoop();