0

Is there a way to save a BitmapImage in a string or int?

So that I can save this in a .txt for example like a hex or binary.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
aeternus
  • 34
  • 4
  • Is [this](https://stackoverflow.com/questions/4161359/save-bitmapimage-to-file) an answer to your question? – Iliar Turdushev Apr 09 '20 at 16:01
  • 1
    You can save image to a stream, an array of bytes, and then what you do with the stream is up to you - saving to disk or converting to byte 64 string with `Convert.ToBase64String(bytes)` – Martin Staufcik Apr 09 '20 at 16:19
  • Does this link answer your question? https://stackoverflow.com/questions/19134062/encode-a-filestream-to-base64-with-c-sharp – Martin Staufcik Apr 09 '20 at 16:20
  • Tnx Martin, For helping in the right direction.This is indeed what I was looking for ```Convert.ToBase64String(bytes)``` – aeternus Apr 10 '20 at 07:45

0 Answers0