[Mono-devel-list] Hangin' agin...

Chris Nuernberger cnuernberger at extendthereach.com
Sun Jul 25 16:41:23 EDT 2004


This code hangs on my system.  I have CVS from just a few days ago.  It
works on a windows XP box perfectly.  I was wondering if it hangs on other
systems, and what paths to take to fix it.  I don't mind filing a bug
report, but I would also like some direction in fixing the problem as this
is the type of stuff I like to do.

Chris

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
class TestMain
{
	public static void Main()
	{
		Image img = new Bitmap( 300, 300,
PixelFormat.Format32bppPArgb );
		Graphics graphics = Graphics.FromImage( img );
		// Get an array of the available font families.
		FontFamily[] families = FontFamily.GetFamilies(graphics);
		// Draw text using each of the font families.
		Font familiesFont;
		string familyString;
		float spacing = 0;
		foreach (FontFamily family in families)
		{
			try 
			{
				familiesFont = new Font(family, 16,
FontStyle.Bold);
				familyString = "This is the " + family.Name
+ "family.";
				graphics.DrawString(
					familyString,
					familiesFont,
					Brushes.Black,
					new PointF(0, spacing));
				spacing += familiesFont.Height;
			}
			catch ( Exception e )
			{
			}
		}
		img.Save( "test.png", ImageFormat.Png );
	}
}



More information about the Mono-devel-list mailing list