PxSubImage (image, x, y, width, height)
An image as a buffer.
The starting x coordinate.
The starting y coordinate.
The width (in pixels) of the sub-image to take.
The height (in pixels) of the sub-image to take.
This function returns a sub-image of the image starting at pixel coordinate (x,y) and of the passed width and height.
This example, ex_PxSubImage.g, is included in the product distribution.
#!/usr/cogent/bin/phgamma require_lisp("PhotonWidgets.lsp"); require_lisp("PhabTemplate.lsp"); PtInit(nil); win = new(PtWindow); pic = PxLoadImage("smiley.bmp"); lab = new(PtLabel); lab.label_type = Pt_IMAGE; lab.label_data = pic; lab2 = new(PtLabel); lab2.SetArea(120,0,100,100); lab2.label_type = Pt_IMAGE; lab2.label_data = PxSubImage(pic,50,20,30,60); PtRealizeWidget(win); PtMainLoop();
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.