Invoking IJG JPEG LIB from C#

  • Thread starter Thread starter Masood
  • Start date Start date
M

Masood

Greetings,

We are writing an application wherein we have to display jpeg images,
we are thinking of using the IJG JPEG LIB written in C code. Will be
greatfull if someone could guide us as to how we can invoke or use the
IJG LIB through C#.


Thanks in Advance
MasooD
 
Masood said:
Greetings,

We are writing an application wherein we have to display jpeg images,
we are thinking of using the IJG JPEG LIB written in C code. Will be
greatfull if someone could guide us as to how we can invoke or use the
IJG LIB through C#.

Don't bother. Windows forms can already display JPEG images just fine. I'm
pretty sure that winforms (via GDI+) actually uses the IJG code - or
something better - under the covers.

See the System.Drawing.Image.FromFile (or .FromStream) methods for creating
an Image from a JPEG file (or stream). If you have the bits of a JPEG image
(e.g. from a database), simply wrap the buffer holding the bits in a
MemoryStream and then use Image.FromStream to decode the JPEG image.

-cd
 
Back
Top