Can you open a JPEG, add text, and resave as a JPEG in .NET?

后端 未结 2 1091
不思量自难忘°
不思量自难忘° 2021-01-13 01:33

I want to write a small program in .NET 4.0 that will open a .jpg (or .jpeg) file, add a line of text to the image, and then resave the image as a .jpg. Does anyone know th

2条回答
  •  甜味超标
    2021-01-13 02:25

    var myBitmap = new Bitmap("C:\\myImage.jpg");
    var g = Graphics.FromImage(myBitmap);
    g.DrawString("My\nText", new Font("Tahoma", 40), Brushes.White, new PointF(0, 0));
    

提交回复
热议问题