Thread Subject: paint skips coordinates :( help!

Subject: paint skips coordinates :( help!

From: Shamane

Date: 21 Sep, 2009 15:26:20

Message: 1 of 1

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

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com