System.Windows.Forms.ThemeWin32Classic.CreateGlyphBitmap C# (CSharp) Method

CreateGlyphBitmap() protected method

protected CreateGlyphBitmap ( Size size, MenuGlyph glyph, Color color ) : Bitmap
size System.Drawing.Size
glyph MenuGlyph
color System.Drawing.Color
return System.Drawing.Bitmap
		protected Bitmap CreateGlyphBitmap (Size size, MenuGlyph glyph, Color color)
		{
			Color bg_color;
			if (color.R == 0 && color.G == 0 && color.B == 0)
				bg_color = Color.White;
			else
				bg_color = Color.Black;
			
			Bitmap	bmp = new Bitmap (size.Width, size.Height);
			Graphics gr = Graphics.FromImage (bmp);
			Rectangle rect = new Rectangle (Point.Empty, size);
			gr.FillRectangle (ResPool.GetSolidBrush (bg_color), rect);
			CPDrawMenuGlyph (gr, rect, glyph, color, Color.Empty);
			bmp.MakeTransparent (bg_color);
			gr.Dispose ();
			
			return bmp;
		}
ThemeWin32Classic