This is a demo project drawboard. I would like to make it so that all clients connected to one server see whatever I draw on that board. I have created a class called
MyMouseEventArgs
class.
I do not know how to proceed after that.
I have posted my code below:
if (isdrawing)
{
using (Graphics gr=this.CreateGraphics())
{
gr.DrawLine(p, prev, e.Location);
cv.Coordinates.Add(prev);
prev = e.Location;
}
}
p.Dispose();
}
This is the function I am using to draw on the form.
This is my serialized class which I am going to pass.
[Serializable]
class MyMouseEventArgs : EventArgs
{
public MyMouseEventArgs(MouseButtons button, int clicks, int x, int y, int delta)
{
_Button = button;
_Clicks = clicks;
_X = x;
_Y = y;
_Delta = delta;
}
private MouseButtons _Button;
private int _Clicks;
private int _Delta;
private int _X;
private int _Y;
public MouseButtons Button { get { return _Button; } }
public int Clicks { get { return _Clicks; } }
public int Delta { get { return _Delta; } }
public Point Location { get { return new Point(_X, _Y); } }
public int X { get { return _X; } }
public int Y { get { return _Y; } }
public static implicit operator MyMouseEventArgs(MouseEventArgs e)
{
return new MyMouseEventArgs(e.Button, e.Clicks, e.X, e.Y, e.Delta);
}
public static implicit operator MouseEventArgs(MyMouseEventArgs e)
{
return new MouseEventArgs(e.Button, e.Clicks, e.X, e.Y, e.Delta);
}
}
Whenever the draw event occurs it has to draw on the client screens too.
I have little knowledge about the concept serialization.
If you help me I promise that I will give you the code for unlimited file transfer over LAN network (c#).