S
solomon13000
The code bellow will enable users to scrible anything on a canvas. Now
what I intend to do is to create a vector object for every position
(pre_x,pre_y,x, y) of the lines drawn on the canvas and send it using
a socket connection to a remote server.
public void mouseDragged(MouseEvent e)
{
if(isButtonPressed==true)
{
pre_x=e.getX()+scrollbarH_value;
pre_y=e.getY()+scrollbarV_value;
isButtonPressed=false;
}
x=e.getX()+scrollbarH_value;
y=e.getY()+scrollbarV_value;
offscreenImageG.drawLine( pre_x, pre_y, x, y);
pre_x=x;
pre_y=y;
repaint();
e.consume();
message.setText(pre_x + ":" + pre_y + ":" + x + ":" + y);
}
Is my apporach considered to be feasible?. Any other ways?
Regards.
what I intend to do is to create a vector object for every position
(pre_x,pre_y,x, y) of the lines drawn on the canvas and send it using
a socket connection to a remote server.
public void mouseDragged(MouseEvent e)
{
if(isButtonPressed==true)
{
pre_x=e.getX()+scrollbarH_value;
pre_y=e.getY()+scrollbarV_value;
isButtonPressed=false;
}
x=e.getX()+scrollbarH_value;
y=e.getY()+scrollbarV_value;
offscreenImageG.drawLine( pre_x, pre_y, x, y);
pre_x=x;
pre_y=y;
repaint();
e.consume();
message.setText(pre_x + ":" + pre_y + ":" + x + ":" + y);
}
Is my apporach considered to be feasible?. Any other ways?
Regards.