none
I want to send picture from server to client RRS feed

  • Question

  • private void button6_Click(object sender, EventArgs e)        {                       try            {                byte[] depthPixelData = new byte[640 * 480]; // your data                Image<Bgr, Byte> img1 = new Image<Bgr, byte>("F:\\6.png");                img1.Bytes = depthPixelData;                acc.Send (depthPixelData ,0,depthPixelData.Length ,0);            }            catch            {                MessageBox.Show("Failure....");            }                    }

    but the picture dosnt send ....can one help me
    Monday, March 11, 2019 8:27 PM

All replies

  • Hi huda-najeeb,

    Thank you for posting here.

    For your question, how do you send the image? Send it by file or stream?

    If you send by file, you could download the source file from the code project for reference.

    https://www.codeproject.com/Articles/461938/Small-File-Transfer-from-Server-to-Client

    This link would be helpful as well.

    https://social.msdn.microsoft.com/Forums/windows/en-US/9082a568-5a96-4933-8c20-3fa6f1bbcb45/how-to-send-and-receive-text-file-in-c-through-tcpip-connection?forum=winforms

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 12, 2019 2:57 AM
    Moderator
  • private void button6_Click(object sender, EventArgs e)        {                       try            {                byte[] depthPixelData = new byte[640 * 480]; // your data                Image<Bgr, Byte> img1 = new Image<Bgr, byte>("F:\\6.png");                img1.Bytes = depthPixelData;                acc.Send (depthPixelData ,0,depthPixelData.Length ,0);            }            catch            {                MessageBox.Show("Failure....");            }                    }

    but the picture dosnt send ....can one help me

    That's it? Where is  yhe rest of you code?
    Tuesday, March 12, 2019 3:33 AM
  • The problem seems to be in your `acc` function which actually sends the image. You didn't post any of that code so we aren't going to be able to help you. You also need to post the exception and details you're getting. That is available from the catch block that you're simply calling MessageBox.Show on. Catch the exception and provide the exception type, message and stack trace information.

    Also please be sure that your code is formatted properly in the code editor. We cannot easily read code that is all on one line.


    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, March 12, 2019 1:41 PM
    Moderator