我有以下问题。我想在C#Windows窗体中制作一些图形。我想将位图读取到程序中,然后在该位图上写一些文本。最后,我希望将此图片加载到pictureBox。这是我的问题。我该怎么做?
例如,它如何工作:
Bitmap a = new Bitmap(@"path\picture.bmp"); a.makeTransparent(); // ? a.writeText("some text", positionX, positionY); pictuteBox1.Image = a;
有可能吗?
Bitmap bmp = new Bitmap("filename.bmp"); RectangleF rectf = new RectangleF(70, 90, 90, 50); Graphics g = Graphics.FromImage(bmp); g.SmoothingMode = SmoothingMode.AntiAlias; g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.PixelOffsetMode = PixelOffsetMode.HighQuality; g.DrawString("yourText", new Font("Tahoma",8), Brushes.Black, rectf); g.Flush(); image.Image=bmp;