The best way to handle this situation is to use an interpolation function to create a curve that smoothly joins the input points of the mouse. The easiest pseudo sample is below, but you can expand it to use bicubic or any spline function.
void DrawPoint( double x, double y )
{
...paint single brush dab.
}
void DrawLine( double x0, double y0, double x1, double y1, double spacing )
{
// get delta
double dx = x1-x0;
double dy = y1-y0;
// Get length
double dist = sqrt( dx \* dx + dy \* dy );
// Normalize
dx \*= 1.0 / dist;
dy \*= 1.0 / dist;
// Travel down the line ( x0, y0 ) ( x1, y1 )
for ( double p = spacing; p <= dist; p+= spacing ) {
// Draw a single point at spacing pixels apart.
double px = x0 + p \* dx;
double py = y0 + p \* dy;
DrawPoint( px, py );
}
}
void MyPaintCode( )
{
for ( int i = 0; i < NumberofPoints; i++ ) {
// Draw lines between input points with 1 pixel spacing.
PaintLine( Input_x[ i ], Input_y[ i ], 1.0 );
}
}