Main Content

imhandles

Get all image objects

Description

himage = imhandles(hparent) returns all of the image objects whose ancestor is hparent. imhandles returns an error if the image objects do not have the same figure as their parent. imhandles ignores color bars.

example

Examples

collapse all

Display an image.

imshow('kobi.png')

Figure contains an axes object. The hidden axes object contains an object of type image.

Return the image object in the current axes.

imageobj = imhandles(gca)
imageobj = 
  Image with properties:

           CData: [1224x1632x3 uint8]
    CDataMapping: 'direct'

  Use GET to show all properties

Display two images in the same figure and use imhandles to get both of the image objects in the figure.

figure
subplot(1,2,1)
imshow('kobi.png')
subplot(1,2,2)
imshow('sherlock.jpg')

Figure contains 2 axes objects. Hidden axes object 1 contains an object of type image. Hidden axes object 2 contains an object of type image.

imageobjs = imhandles(gcf)
imageobjs = 
  2x1 Image array:

  Image
  Image

Inspect the first image in the imageobjs array.

imageobjs(1)
ans = 
  Image with properties:

           CData: [640x960x3 uint8]
    CDataMapping: 'direct'

  Use GET to show all properties

Input Arguments

collapse all

Parent graphics object, specified as a handle to a figure, axes, uipanel, or image graphics objects.

Output Arguments

collapse all

Image objects whose ancestor is hparent, returned as an image or array of images.

Version History

Introduced before R2006a

See Also

|