| Image Processing Toolbox | Search  Help Desk |
| getimage | Examples |
Syntax
A = getimage(h) [x,y,A] = getimage(h) [...,A,flag] = getimage(h) [...] = getimage
Description
A = getimage(h) returns the first image data contained in the Handle Graphics object h. h can be a figure, axes, image, or texture-mapped surface. A is identical to the image CData; it contains the same values and is of the same class (uint8 or double) as the image CData. If h is not an image or does not contain an image or texture-mapped surface, A is empty.
[x,y,A] = getimage(h) returns the image XData in x and the YData in y. XData and YData are two-element vectors that indicate the range of the x-axis and y-axis.
[...,A,flag] = getimage(h) returns an integer flag that indicates the type of image h contains. This table summarizes the possible values for flag.(gca).
Class Support
The output arrayA is of the same class as the image CData. All other inputs and outputs are of class double.
Example
This example illustrates obtaining the image data from an image displayed directly from a file.imshow rice.tif I = getimage;