After digging around, I found no way of programmatically drawing an existing rectangle on the matlab.ui.control.image object... Instead, I have used this technique:
- Insert Axes object on the app UI (app.OrgImageAxis in the sample below),
- Use imshow() providing the image, and set Axes object created in the previos step as Parent
- use rectangle() to draw rectangles on the axis created in first step...
app.vImage = imread(fullpath);
imshow(app.vImage, 'Parent', app.OrgImageAxis);
bl = app.GS.Blocks(iInd);
rect = [bl.iPosX bl.iPosY app.vCols app.vRows];
rectangle(app.OrgImageAxis, 'Position', rect);
Anyway... if, nevertheless, anyone knows how to draw shapes directly on the matlab.ui.control.image object, could you please answer the question?