Click here to Skip to main content
15,902,114 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, I'm having problems drawing on my canvas.

When the user clicks on the canvas, I'm getting the coordinates through jQuery and passing them in the code behind.

The method that is receiving the parameters has to be static therefore I'm developing the drawing code into another method which has a return type of StringBuilder. So from the static method that is receiving the coordinates, I'm instantiating the class I;m working in and calling that method but still nothing is drawn on the canvas. I tried it using a button and worked perfectly.
Thanks!

<br />
<pre lang="cs">public void add(int xPosition, int yPosition)<br />
       {<br />
           StringBuilder sb = new StringBuilder();</pre><br />
//code..<br />
<br />
ClientScript.RegisterStartupScript(this.GetType(), "TestScript", sb.ToString());<br />
}<br />


<pre lang="cs">[WebMethod]<br />
        public static void mousedown(int xc, int yc)<br />
        {<br />
            Create cm = cm.Button1_Click(null, null);<br />
            return new Create().add(xc, yc);<br />
<br />
        }</pre><br />
Posted
Updated 30-May-14 11:13am
v2
Comments
RDBurmon 30-May-14 8:58am    
Can you post code here? so that we can understand what you have tried so far
developerjm 30-May-14 17:13pm    
I updated the code. Thanks.
Nirav Prabtani 30-May-14 8:58am    
can you post code sample here??
developerjm 30-May-14 17:13pm    
I updated the code. Thanks.
[no name] 30-May-14 17:17pm    
Isn't this "question" the same as http://www.codeproject.com/Questions/778281/How-to-fill-text-in-canvas-using-stringbuilder?arn=0 only with less information in it?

1 solution

Can't find a solution for this.
 
Share this answer
 

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