Hello, :)
I have edited this question to make it easier to understand.
I have an image file and I have to store the image data into an existing file in binary. And when that file gets opened in my program again, that binary data should be somehow read and that image displayed inside a picturebox. How would I go about doing this in C#?
Any help/suggestions much appreciated.
Thank you jase
EDIT:
Because our files are of the following structure:
Control
"Text here"
Location
...And there will be many cases where there are more than one or a few controls in the same file like so:
Label
"This is a label"
23, 44
Label
"This is another label"
23, 64
LinkLabel
"This is a linkLabel"
23, 84
...
I don't know where to place/save the following code:
Maybe inside the file like so...:
Image
"<controlLocationData type="Image">
<Data>
Base64 encoded image data here
</Data>
<FreeformLocation>60, 40</FreeforLocation>
</controlLocationData>"
60, 40
and then use this code below to save/load and display the image?...
var image = LoadBitMap("My Bitmap");
var stream = new MemoryStream();
image.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp);
string base64Encoded = Convert.ToBase64String(stream.ToArray());