from array byte to bitmap
-
hi... i send image as byte from server (this work in c# program ) i want ask how to receive this byte array in wp7 client and convert it bitmap? plz i need ur help
-
hi... i send image as byte from server (this work in c# program ) i want ask how to receive this byte array in wp7 client and convert it bitmap? plz i need ur help
Assuming you have actually received the bytes, it's easy:
MemoryStream ms = new MemoryStream(bytes); Image returnImage = Image.FromStream(ms);
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
-
Assuming you have actually received the bytes, it's easy:
MemoryStream ms = new MemoryStream(bytes); Image returnImage = Image.FromStream(ms);
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
-
Well, that depends if the content in the stream is a valid image file that's just been streamed. I think more information about what's in that array of bytes is necessary.
Hi Hi, From what I see from OriginalGriff's response (and the original query) he is correct. As long as the receiving end is expecting an image in the stream being sent then all should be rendered okay. I've personally used this technique on a few occasions and it worked quite nicely. Having said that, I also see the point you are making and I believe that some kind of error checking or (what I prefer using) handshake response/acknowledge to ensure that what data is being streamed is what is to be expected and will therefore be implemented properly. Just me two cents :),
Cheers, Glen Vlotman "You cannot code for stupidity"