Path: news.mathworks.com!not-for-mail
From: "Shamane " <tan.shamane@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: paint skips coordinates :( help!
Date: Mon, 21 Sep 2009 15:26:20 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 25
Message-ID: <h985us$bot$1@fred.mathworks.com>
Reply-To: "Shamane " <tan.shamane@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1253546780 12061 172.30.248.37 (21 Sep 2009 15:26:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 21 Sep 2009 15:26:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1970882
Xref: news.mathworks.com comp.soft-sys.matlab:571819


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