found the problem :
Code:
public Bitmap ConvertTextToBitmap(int width, int height, string str, Font fontName)
{
using (Bitmap bmp = new Bitmap(width, height))
{
using (Graphics gfx = Graphics.FromImage((Image)bmp))
{
gfx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
Font font = fontName;
gfx.FillRectangle(Brushes.Transparent, new Rectangle(0, 0, bmp.Width, bmp.Height));
gfx.FillRectangle(Brushes.White, 0, 0, width, height);
gfx.DrawString(str, font, new SolidBrush(Color.Black), 2, 3);
return bmp;
}
}
}
looks like the returned bitmap is corrupted all values throw exception.
didnt knew that would happen. any explanation ???????