views:

1761

answers:

4

It seems that .NET can't open JP2 (Jpeg 2000) files using the GDI library. I've searched on google but can't find any libraries or example code to do this.

Anybody got any ideas? I don't really want to pay for a library to do it unless I have to..

+1  A: 

maybe you should checkout this project. regards

Joachim Kerschbaumer
This relies on J# which is not in Visual Studio 2008 +
John JJ Curtis
+1  A: 

I was looking for something similar a while back, with a view to implementing one if I could; The responses to my question imply that there is no documented method to do this for GDI+ which the Image class in .Net uses.

I believe that if you're writing a WPF application, then you can extend the list of supported image formats through Windows Imanging Components codecs, and there may be one out there already (ask your local friendly search engine?)

There is an option to use an addon such as DotImage which supports JPEG2000, although there may be more "effort" involved in loading images.

Rowland Shaw
A: 

I've used Leadtools to display JPEG 2000 images. They provide a .NET library including WPF and WinForms controls to display the images. However, there is a reasonably steep price tag.

Taylor Leese
A: 

Seems like we can do it using FreeImage (which is free)

FIBITMAP dib = FreeImage.LoadEx("test.jp2");
//save the image out to disk    
FreeImage.Save(FREE_IMAGE_FORMAT.FIF_JPEG, dib, "test.jpg", FREE_IMAGE_SAVE_FLAGS.JPEG_QUALITYNORMAL);
//or even turn it into a normal Bitmap for later use
Bitmap bitmap = FreeImage.GetBitmap(dib);
Gordon Carpenter-Thompson