Open AndrewKaplanovsky opened 8 years ago
Hmm.. It seems like it depends on the speed with which I call this function. If there are delays between calls, everything works without any errors.
@AndrewKaplanovsky Strange. I will look into this as soon as I have time, but I will be away for a few weeks now. Please note that I just now have published updates on NuGet which I hope will solve the issue with Image.Save
on Windows Universal.
@anders9ustafsson Thank you!
Hi Anders,
Sorry for my annoyance, but when I try to clone a Bitmap, from time to time I get a System.NullReferenceException exception:
at (wrapper unknown) ImagePixelEnumerator.Helpers.Pixels.NonIndexed.PixelDataPArgb8888:PtrToStructure (intptr,object) at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:PtrToStructure (intptr,System.Type) at ImagePixelEnumerator.Helpers.Pixel.ReadRawData (IntPtr imagePointer) [0x00000] in d:\Users\Anders\Documents\Visual Studio 2013\Projects\aforge\Sources\System.Drawing\Helpers\Pixel.cs:272 at ImagePixelEnumerator.Helpers.ImageBuffer.ReadPixel (ImagePixelEnumerator.Helpers.Pixel pixel, System.Byte[] buffer) [0x0001f] in d:\Users\Anders\Documents\Visual Studio 2013\Projects\aforge\Sources\System.Drawing\Helpers\ImageBuffer.cs:211 at ImagePixelEnumerator.Helpers.ImageBuffer+<>cDisplayClass5.b 4 (ImagePixelEnumerator.Helpers.LineTask lineTask) [0x00075] in d:\Users\Anders\Documents\Visual Studio 2013\Projects\aforge\Sources\System.Drawing\Helpers\ImageBuffer.cs:492
at System.Threading.Tasks.Parallel+cAnonStorey5`2[TSource,TLocal].<>m0 (Int32 i) [0x00000] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/threading/Tasks/Parallel.cs:2318
at System.Threading.Tasks.Parallel+cAnonStorey3`1[TLocal].<>m1 () [0x000ed] in /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/mscorlib/system/threading/Tasks/Parallel.cs:1204
The code is following:
public Bitmap ProcessImage(Bitmap src) { if (src == null) { return null; }
}
The project is a portable library, I get this error when using it in Droid project. First time when I call this code everything works fine, but then is I call it subsequently, at one step the code just crashes with the exception.
Thank you, Andrew