Paul Maddox

Software development team leader specialising in Microsoft Visual C# and C++ from the Northwest of England. Experience working in a globalised business and team; understanding of enterprise business operation and practices; experience reporting to executive management Skills in numerous languages and technologies; knowledge of formal software development lifecycle; experience of architecture design

Monday, November 17, 2008

Out of Memory / OutOfMemoryException on Graphics.FromImage with PixelFormat.Format16bppArgb1555 or PixelFormat.Format16bppGrayScale

If you have some code like this:

Bitmap bmp = new Bitmap(100,100, PixelFormat.Format16bppArgb1555);
Graphics gfx = Graphics.FromImage(bmp);

You will find you get an out of memory exception upon executing the code. The reason? .NET does not actually support Format16bppArgb1555 or PixelFormat.Format16bppGrayScale.

0 Comments:

Post a Comment

<< Home