Main Content

imhandles

Get all image objects

Description

example

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.

Examples

collapse all

Display an image.

imshow('kobi.png')

Return the image object in the current axes.

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

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

  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')

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'

  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.

See Also

|

Introduced before R2006a