Can I call a graphics object's method using the object's handle? (R2014B)
    4 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
Hi all,
I was wondering if I can call a graphics objects method when I only have a handle to the object. Say for example, if I find a polygon in an image:
hPoly = findobj(gca(), 'tag', 'impoly');  % N.B. I'd love a more "robust" way than searching by tag
And I want to invoke the polygon objects createMask method:
BW = hPoly.createMask;  % not gonna work
I found the iptgetapi function but it doesn't provide the full set of methods. Currently I'm creating a new object and deleting the handle which is pretty ugly, e.g.
api = iptgetapi(hPoly);
verts = api.getPosition();
oPoly = impoly(gca(), verts);
delete(hPoly);
Thanks for any help
0 commentaires
Réponses (0)
Voir également
Catégories
				En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
