How does one convert between System.Drawing.Icon type and byte[]? I’m looking for something simple that can (hopefully) work in .NET2.
How does one convert between System.Drawing.Icon type and byte[] ? I’m looking for something
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You go via a
MemoryStream, basically:(Historical note: I wasn’t sure whether or not it was safe to dispose of the stream passed to the constructor. It isn’t safe to do so for
Bitmap, for example… that holds on to the stream and may read from it later. Apparently it’s okay forIconthough. I wish MSDN made this clearer…)