Hello everyone,
I have some phone to each user and I want to store all photos into memory with key-value pair. Key is the user name and value is the binary photo stream. Any ideas how to store binary photo content into memory? Which data structure is suitable to be used?
thanks in advance,
George
Bechir BejaouiPosted Nov 30, 2008, 10:32 AM
byte[]ImageData = Convert.FromBase64String(stringContent);
MemoryStream oStream = new MemoryStream(ImageData);
Image myImage = Image.FromStream(oStream);
George GeorgePosted Nov 29, 2008, 4:15 AM
Could I just use byte[] other than using MemoryStream? Any pros of using MemoryStream?
byte[] imageData = System.IO.File.ReadAllBytes(filePath);
regards,
George
Bechir BejaouiPosted Nov 28, 2008, 7:04 PM
For the first question use MemoryStream object to set bytes in the memory
For the second question use a dictionary object