Brett McCoy wrote:
> On Wed, Jul 23, 2008 at 5:57 AM, Vivek R <[EMAIL PROTECTED]> wrote:
>   
>> I have a code to draw a line ... draw a pixcel ...
>> I want draw using a mouse .....
>>     
> Operating system?
>
> If you know how to draw a pixel, then for free hand drawing, you just
> need to find the current coordinates of the mouse pointer when the
> left button is pressed and draw a pixel (or, better yet, get current
> brush size and paint that). If the button is held, you need to keep
> drawing pixels, but only if the position changes.
>   

Depending on the API for the OS/platform, there should be a way to draw 
a sequence of lines. At each polling interval for the mouse, grab the 
coordinates and draw a line from the previous coordinates. This tends to 
produce a smoother, more complete line.

-- 
John Gaughan

Reply via email to