Invoking IJG JPEG LIB from C#

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
 
C

Carl Daniel [VC++ MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top