0

Can I convert any bytes array (byte[]) to jpeg image in C# ? For example, if I convert text or word or pdf file into bytes array , then Is it possible to convert this array to jpeg image in C# ?

Yazan Rawashdeh
  • 1,017
  • 2
  • 16
  • 26
Masoud Bahrami
  • 111
  • 1
  • 12

1 Answers1

0

No, you will need an external converter. What you can do is convert a bunch of bytes that already is a jpeg into an instance of a jpeg object. But if your byte array represents something that is not a jpg (or other graphics format) you cannot convert it to a jpg with native .NET means.

nvoigt
  • 75,013
  • 26
  • 93
  • 142
  • External resources are off topic here, but you can find examples in [this](http://stackoverflow.com/questions/6775048/save-pdf-to-jpeg-using-c-sharp) answers. You will need a library for each conversion you want to do. – nvoigt Mar 30 '15 at 06:02