How do I get bytes out of a PNG file using C#, (Reason for this:I need to pass the PNG as a string in an XML file.)
System.IO.File.ReadAllBytes
System.Convert.ToBase64String
System.Convert.ToBase64String(System.IO.File.ReadAllBytes(filePath));
Alternatively, if you have the PNG file in memory:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With