AtelierElieScripter.ResourceObjects.JapFontResourceObject.GetTextWithChoiceBoxBitmap C# (CSharp) Метод

GetTextWithChoiceBoxBitmap() публичный Метод

public GetTextWithChoiceBoxBitmap ( string text ) : Bitmap
text string
Результат System.Drawing.Bitmap
        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;
        }