I am trying to add text over an image, and it works good if the text is short. However, if I add longer text it will be cut off at the edge.
I need the text to come to a new line if it's too long.
Here's the code I have so far:
Graphics graphicImage = Graphics.FromImage(bitMapImage);
//Smooth graphics is nice.
graphicImage.SmoothingMode = SmoothingMode.AntiAlias;
Font font = new Font("Tahoma", 6);
int x_axis = 50;
int y_axis = 120;
int distance = 50;
graphicImage.DrawString("This is a very long text and this long text might come to a new line below", font, Brushes.Yellow, new PointF(x_axis, y_axis + distance * 2));
String tempFile = folder + "output.jpeg";
bitMapImage.Save(tempFile, ImageFormat.Jpeg);
And here is the image it creates
How can I make the text wrap?