Howto: image to byte array
-
Hello all, What is the quickest way to convert an image to a byte array? Is it image -> file -> byte array ? Or is there a short cut ? Thanks Smitha Imagination is more important than knowledge. --Albert Einstein
-
Hello all, What is the quickest way to convert an image to a byte array? Is it image -> file -> byte array ? Or is there a short cut ? Thanks Smitha Imagination is more important than knowledge. --Albert Einstein
Smitha Vijayan wrote: What is the quickest way to convert an image to a byte array? I am not sure if you mean performance or easiest to code, but you can just use the Image's Save method, and pass a MemoryStream instead of some sort of file stream. A MemoryStream can write to an array of bytes. Saving to a file would be very slow in performance, and not necessary in this case. Cheers
-
Smitha Vijayan wrote: What is the quickest way to convert an image to a byte array? I am not sure if you mean performance or easiest to code, but you can just use the Image's Save method, and pass a MemoryStream instead of some sort of file stream. A MemoryStream can write to an array of bytes. Saving to a file would be very slow in performance, and not necessary in this case. Cheers
Thanks Jeff Smitha Imagination is more important than knowledge. --Albert Einstein