yosef_ghobadi
سه شنبه 31 شهریور 1394, 10:50 صبح
سلام به اساتید
چطور میشه متنی رو که در برنامه روی عکس نوشتم با عکس تلفیق بشه و ذخیره کنم؟
drsina
سه شنبه 31 شهریور 1394, 11:54 صبح
string firstText = "Hello";string secondText = "World";
PointF firstLocation = new PointF(10f, 10f);
PointF secondLocation = new PointF(10f, 50f);
string imageFilePath = @"path\picture.bmp"
Bitmap bitmap = (Bitmap)Image.FromFile(imageFilePath);//load the image file
using(Graphics graphics = Graphics.FromImage(bitmap))
{
using (Font arialFont = new Font("Arial", 10))
{
graphics.DrawString(firstText, arialFont, Brushes.Blue, firstLocation);
graphics.DrawString(secondText, arialFont, Brushes.Red, secondLocation);
}
}
bitmap.Save(imageFilePath);//save the image file
vBulletin® v4.2.5, Copyright ©2000-1403, Jelsoft Enterprises Ltd.