Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using serial port to receive image from other computer in asp.net. I am using other software to send image to my serial port it will sent perfectly and i am also receive it to my port buffer but i get it in byte so i can't see it in my image control i am using this code to receive and display image:

C#
byte[] comBuffer;
           int bytes;
           if (comport.IsOpen)
           {
               bytes = comport.BytesToRead;
               comBuffer = new byte[bytes];
               comport.Read(comBuffer, 0, bytes);
               int test_bytes = comport.BytesToRead;
               ComBuffer_Test = new byte[test_bytes];
               comport.Read(ComBuffer_Test, 0, test_bytes);
               for (int i = 0; i < test_bytes; i++)
               {
                   sb_testdata.Append(ComBuffer_Test[i]);
                   sb_testdata.AppendFormat(" ", ComBuffer_Test[i]);
               }
 temp_test = sb_testdata.ToString();

Image1.ImageUrl = temp_test.ToString();


Image1 is my image control id.
How can i see image to my control.
Posted
Updated 19-Apr-12 19:49pm
v3
Comments
bbirajdar 20-Apr-12 2:26am    
Your code will only work on the server. It will not work on clients machine. The asp.net web application does not have access to the serial ports on clients machine..

Its the time to fire your team lead

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