C # Mono {new Bitmap ("fileName");} Just freezes on OSX

When I try to download ".bmp", ".png" or ".jpg" in OSX 10.7.3 using the monophonic version of the System.Drawing.Bitmap object, the applications simply freeze. I am not getting errors, the application just gets stuck in the Bitmaps constructor ...

When I run the same code on (Arch) Linux or Windows, everything works fine.

public static void Main (string[] args) { using (var bitmap = new Bitmap("/....../image.bmp")) { } Console.WriteLine ("Hello World!");// Never gets here... } 

If I pause the application in debug mode, it opens the "disassembly" window and shows that it is stuck in this line:

 call Status System.Drawing.GDIPlus:GdiplusStartup (UInt64, GdiplusStartupInput, GdiplusStartupOutput) 

NOTE. After pausing the application in debug mode several times, it "Magically" began to work when writing this message. I promised that I hadn’t changed anything. Does anyone know what can make "System.Drawing.GDIPlus" hang, so I know how to avoid it? Is there a mono codex settings file or something that could ruin a bit?

+7
source share
2 answers

The problem is simply performance. This has nothing to do with you; the image just takes longer to load.
Mono-processing System.Drawing is just a C # shell and is incomplete and not (or incorrectly) provides all the functions in System.Drawing . It can function well in windows because it uses its own GDIPlus.dll , but it can work poorly on unix-based systems because it uses the Cairo engine. You can find more information here .

+5
source

Having the same problem with the new installation of Mono 3.8 on 10.10; but he left, suspiciously after I broke down while hanging, seeing stream number 4 in GdiplusStartup ().

Perhaps this is due to a break, or maybe GdiplusStartup takes a lot of time on first launch in OS X, doing font caching or something like that.

+1
source

All Articles