|
Hi All! :)
I am trying to paint different colours on images read in to the GUI, and have managed to do so according to the mouse click and movement. However, now there's one problem. It will only paint freehand if I move my mouse slowly. However, should my mouse move fast, the paint will skip quite a few coordinates and you will only see splashes of dots scattered along the lines I drew. Is there a way to help this? Thank you so much in advance!!
Here's a snippet of the code:
function MouseMotionFcn(gcbo,eventdata,handles)
handles = guidata(gcbo);
if handles.drawFlag
clicked = get(gca, 'currentpoint');
xi = ceil(clicked(1,1));
yi = ceil(clicked(1,2));
handles.color = handles.mGetColorFcn();
p = plot(xi, yi);
set(p,'marker','.')
set(p,'markersize',30)
set(p,'Color', handles.color);
end
guidata(gcbo,handles);
|