Je veux ajouter du texte à une image, parce que le texte est trop long, donc j'ai besoin de vérifier le texte.width> image.width, si oui, j'ai besoin d'une nouvelle ligne automatique. J'ai aussi besoin de vérifier le texte.Hauteur> image.height, si oui j'ai besoin d'une autre image pour dessiner text.i également dessiné le texte sur l'image.Comment faire un saut de ligne automatique dans Windows Mobile avec C#
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;
}
}
thank you réponse, je l'utilise Hava MeasureString(), la question clé est que je donot savoir comment newline automatique , Comment juger ce que le personnage atteint la frontière.De quel personnage pour commencer une autre ligne. – pengwang