Creating Images with Mono / C#

I just wrote some sample code on how to create GIF images in C#:

using System;
using System.Drawing;
using System.Drawing.Imaging;


public class Tester {
  static void Main() {
    Bitmap bmp = new Bitmap(79,121);
    Graphics graph = Graphics.FromImage(bmp);
    Font font = new Font("Times", 6, FontStyle.Italic);

    for(int i=0; i<10000; i++) {
      graph.Clear(Color.White);
      graph.DrawString(i + " - Test", font, SystemBrushes.WindowText, 1, 1); 
      bmp.Save(i + "foo.gif", ImageFormat.Gif);
    }
  }
}

To compile that code you have to make an reference:

$ mcs -r:System.Drawing pic01.cs

To create 10.000 images takes about 12 seconds on my notebook. If you prefer PNG it takes a little bit longer ~ 26s.

FC5 - install j2sdk1.4.2_06

I just tried to install j2sdk1.4.2_06 under FC5 and got:

[root@w0004 stage]# bash j2sdk-1_4_2_06-linux-i586.bin

...

Do you agree to the above license terms? [yes or no]
yes
Unpacking...
tail: cannot open `+486' for reading: No such file or directory
Checksumming...
1
The download file appears to be corrupted.  Please refer
to the Troubleshooting section of the Installation
Instructions on the download page for more information.
Please do not attempt to install this archive file.

hmm... well, Google is always your best friend :-).

You need to set:

[root@w0004 stage]# unset _POSIX2_VERSION=199209

to work around that problem.