Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Can any one help me to access multiple users multiple users to access same canvas at same time in html5 to draw with selection of color. in few samples color code is mentioned. so it will reflect on both pages.

I am failing while i will make it color Selection Tool.

please help me.


Thanks,
Posted
Comments
Afzaal Ahmad Zeeshan 11-Nov-14 1:37am    
What do you mean by multiple users?

Each user will have his own machine and every machine will get a distinct canvas in the Browser and thus they can easily draw what they want to.
Manas Bhardwaj 11-Nov-14 3:45am    
You are right. Please see my answer with possible solution.
Member 10476553 11-Nov-14 3:01am    
ya for eg: http://chatndraw.herokuapp.com please go through this link. where canvas can used by multiple users. when color is selected it reflects in both canvas.

1 solution

Canvas [^] is an element which runs on your browser itself. So, you can't directly let two users use it at the same time.

What you could do perhaps is use something like SignalR [^]to send the changes back to server and reflect it on other user's browsers to give this kind of effect.

Look at the following articles to get head start:

Online Whiteboard using HTML5 and SignalR[^]

http://www.danielroot.info/2013/01/a-signalr-whiteboard.html[^]
 
Share this answer
 
v2
Comments
Afzaal Ahmad Zeeshan 11-Nov-14 3:48am    
Although the question was somewhat vague but you've used his key points of canvs and same time and provided him with a good answer. +5 from my side.
Manas Bhardwaj 11-Nov-14 3:51am    
thx Afzaal!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900