• Advertisement
Sign in to follow this  

Sending a .Net Bitmap to a native C++ server

This topic is 4148 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to send an image from a PDA to a server. PDA part is coded in .Net, the image being a Bitmap class. I tried the following but I doubt on the C++ side, I can "understand" what this Bitmap class' data is... I just want the image to get to the server in a format I can understand.
// PDA side
MemoryStream ms = new MemoryStream();
image.Save(ms, ImageFormat.Bmp);
byte[] imageBuffer = ms.ToArray();
networkStream.Write(imageBuffer, 0, (int)imageBuffer.Length);

// Server side
while (total < length && (bytesReceived = recv(socketClient, &buffer[total], length - total, 0)) != 0)
    total += bytesReceived;
    HBITMAP tmp = (HBITMAP)buffer;       // doesn't seem to work
Any ideas? Thanks

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement