Reputation: 153
I'm using MATLAB to create a GUI. I have an image on which the datacursormode is enabled. This works fine, every time I click a new point is added. For every point MATLAB displays a box with the coordinates (or whatever other text, I modified it using an update function). But how can I remove this text box, I just want a point to be added, no extra information should be displayed?
Thanks!
Upvotes: 2
Views: 3115
Reputation: 19880
datacursormode on
is used to enable data tip display on a graphic object. In other words that text box you want to hide. What the reason then to use datacursor?
Are you using UpdateFcn
of data cursor to "add pixel" (you probably mean to change pixels color)? Consider using ButtonDownFcn callback function instead.
function interactive_image(im)
fh = figure;
hImage = imshow(im);
set(hImage,'ButtonDownFcn',@myfunction)
end
function output_txt = myfunction(obj,eventdata,handles)
pos = get(gca,'CurrentPoint')
x = get(obj,'CData');
x(uint32(pos(1,2)),uint32(pos(1,1))) = 0;
set(obj,'CData',x)
end
UPDATE:
According to your comment you better to use IMPOINT function available in Image Processing Toolbox.
Upvotes: 1