- Home /
Issues with Image class in C# dll
So I'm working on a game where we're decoding a custom file format. I need to be able to save using the C# Image class. I've stripped down the code and found that unity 3 (and 2.6) crashes when I try to do the following.
Image ImageOne = new Bitmap(FilePath);
Image ImageTwo;
MemoryStream AStream = new MemoryStream();
ImageOne.Save(AStream, ImageFormat.Tiff);
ImageTwo = new Bitmap(AStream);
ImageTwo.Save(@"C:\NewPic.jpg");
Unity crashes on the ImageOne.Save call. My dll is compiled using .NET 3.5 and I've got a test app using 3.5 that runs and the code works. Has anyone encountered this and found a solution or a way around it?
Comment
Your answer
Follow this Question
Related Questions
External DLL requiring Image 0 Answers
NativeSpoutPlugin.dll caused an Access Violation (0xc0000005) 0 Answers
Why does my build keep crashing? 2 Answers
windows standalone application crash when run (caused by external dll ) 0 Answers
Connecting external application (e.g. Notepad) to Unity 0 Answers