[.net] Saving to JPEG compression in .NET with C++

Started by
14 comments, last by The Parrot 18 years, 9 months ago
Yes I seem to be getting the same problems... which is really really odd.

I've written a wrapper class myself, in C#, then done a c++ app like so:

	ImageCodecInfo* ici = Helper::ImageCodecInfoRetrieve::GetImageCodecInfo(S"image/jpeg");	if (ici!=0)		Console::WriteLine(ici->ToString());


and I get the same error on the ToString() call... Very very odd.

What methods do you need? those could easily be wrapped up too...

here is the C# wrapper btw:

using System;using System.Drawing.Imaging;namespace Helper{	public class ImageCodecInfoRetrieve	{		public ImageCodecInfoRetrieve()		{		}		public static ImageCodecInfo GetImageCodecInfo(string mime)		{			ImageCodecInfo[] encoders;			encoders = ImageCodecInfo.GetImageEncoders();			for(int j = 0; j < encoders.Length; ++j)			{				if(encoders[j].MimeType == mime)					return encoders[j];			}			return null;		}	}}
Advertisement
Same odd-ly placed error as I'm getting (only on a different spot); and I'm trying to use exactly the same function.

I never got to making the wrapper as quite frankly I haven't got a clue how to make such a thing in the Developer version of VS.NET that I have :|...

It's odd that the wrappers are named as a potential solution but don't work nontheless - if this problem really persists I might contact Microsoft about it (well, it's their bug, really) and might get free help from them (though them being Microsoft that is at least not something you can actually count on).
--Jeroen Stout - WebsiteCreator of-Divided
I haven't found a solution yet, but I thought I'd bump this thread as I'm sure there aught to be some solution... :)
--Jeroen Stout - WebsiteCreator of-Divided
So... the methods/properties you need in the ImageCodecInfo class are?

and how do you use it? ie, do you pass it as a parametre to another object's method?
The only thing I need is to get a ImageCodecInfo class with the JPEG-codec information, which I then pass to the Image::Save(...) function to save it to a stream - using an image I opened, of course.
--Jeroen Stout - WebsiteCreator of-Divided
Another bump :)... if this leads to nothing I'm going to have to find another way.
--Jeroen Stout - WebsiteCreator of-Divided

This topic is closed to new replies.

Advertisement