1

I have a file that is obtained from X-Ray machine , the extension of the file is .raw. What I need is to display this file in a picture box , How can be done in c# ?

Note : I have tried to convert it to byte array than to load it , the image is shown but corrupted. I tried Image.FromFile() , error of (Out of memory) is thrown . I tried to load from a stream and also an error occured (Paramater not valid).

Jongware
  • 22,200
  • 8
  • 54
  • 100
Hasan Shouman
  • 2,162
  • 1
  • 20
  • 26
  • Find the documentation of the machine, find out the actual format it outputs, then search for ".NET image library {format}". Profit. – CodeCaster Aug 26 '14 at 11:26
  • 1
    `raw` means the format of the image is specific to the device that captured it - it isn't going to be encoded with any codec windows has. You'll need to ask the people that made the Xray machine how to re-encode the image. – vcsjones Aug 26 '14 at 11:26
  • Could you post your code where you tried? – Renatas M. Aug 26 '14 at 11:28
  • What is the size of the image? How much memory is available to your application? You probably need to solve these problems as well as finding a way to convert the image to a format that you can then display. – Simon Aug 26 '14 at 11:29
  • 1
    @Simon [GDI+, used by System.Drawing internally, often (incorrectly) throws OutOfMemoryException](http://stackoverflow.com/questions/771819/system-outofmemoryexception-out-of-memory-gdi). – CodeCaster Aug 26 '14 at 11:33
  • I concur with the advise to check the documentation. Medical imaging is often 12-bit per pixel grayscale. That requires special handling. – user3344003 Aug 27 '14 at 16:29
  • Can you post the first 12 bytes of your image? That might help us identify the format of the file. – dlemstra Aug 29 '14 at 11:20
  • Thanks all for help.How to get the bytes?? – Hasan Shouman Sep 01 '14 at 16:22

0 Answers0