i want to add text to a image,because the text is too length,so i need check the text.width > image.width,if yes,i need automatic newline.also i need check the text.height > image.height,if yes i need other image to draw text.i also drawed text on image.
public int makePictrue(string address, string pictrueAddress, string[] str, int[][] intPoint, Font font, SolidBrush solidB)
{
try
{
for (int i = 0; i < str.Length; i++)
{
Bitmap bmp;
if (pictrueAddress.Trim() == "")
{
bmp = new Bitmap("1.jpg");
}
else
{
bmp = new Bitmap(pictrueAddress);
}
g = Graphics.FromImage((Image)bmp);
g.DrawString(str[i], font, solidB, intPoint[i][0], intPoint[i][1]);
MemoryStream stream = new MemoryStream();
bmp.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
bitmap = bmp;
}
return 1;
}
catch (Exception ex)
{
return 0;
}
}