Suppose structured
public struct stStaff
{
public WhatType? Picture; // Pictures 3x4 (what kind for pictures ?)
public string FullName; // FullName
public DateTime BirthDay; // Birthday
}
Can save images to a structured text file (note: do not store the path of the image), to save the image of the structure of text files will have style? one example of this?
Loading
VulpesPosted Nov 22, 2012, 6:53 AM
However, you can't use BinaryWriter to write a Bitmap directly to a file.
You have to convert the Bitmap to a byte array first and then write that to the file. There is an overload of the Write method which takes a byte array as a parameter:
http://msdn.microsoft.com/en-us/library/bx149a0k.aspx
Dong Lam TrienPosted Nov 21, 2012, 10:27 PM
in my save button code
I get an error at this line
bw.Write(Staff.Picture); // warning error: The best overloaded method match for 'System.IO.BinaryWriter.Write(bool)' has some invalid arguments
I wonder in the text file can save the Bitmap type? or to switch to the new chain store? if it is correct on how?
VulpesPosted Oct 19, 2012, 4:53 AM
http://www.codeproject.com/Articles/15460/C-Image-to-Byte-Array-and-Byte-Array-to-Image-Conv