I have the following code:
FileStream fs = new FileStream(@"\path\imagem1.png", FileMode.Open, FileAccess.Read);
Image image = Image.FromStream(fs);
fs.Close();
Bitmap b = new Bitmap(image);
Graphics graphics = Graphics.FromImage(b);
graphics.DrawString("Meu texto", new Font("Arial", 50), Brushes.White, 0, 0);
b.Save(@"\path\resultado.png", image.RawFormat);
image.Dispose();
b.Dispose();
Yes,thereisanimagethere!Butitdoesnothavebackgroundcolor,italsohasagreatleveloftransparency.
TheproblemisthatIwouldliketoputabackgroundonit,sotheresultwouldbe:
I tried to draw a red rectangle, but it overlays the image.