public Bitmap GetTextWithChoiceBoxBitmap(string text)
{
Bitmap textBitmap = GetTextBitmap(text, CHOICEBOXMAXWIDTH, CHOICEBOXLINES, CHOICEBOXLINESPACING);
Bitmap textWithBoxBitmap = GetChoiceBox(12 * text.Length);
Imaging.ImageAttributes attr = new Imaging.ImageAttributes();
attr.SetColorKey(Color.Black, Color.Black);
using (Graphics g = Graphics.FromImage(textWithBoxBitmap))
{
g.InterpolationMode = InterpolationMode.NearestNeighbor;
// Draw Text
Rectangle textRect = new Rectangle(1, 1, textBitmap.Width, textBitmap.Height);
g.DrawImage(textBitmap, textRect, 0, 0, textBitmap.Width, textBitmap.Height, GraphicsUnit.Pixel, attr);
}
return textWithBoxBitmap;
}