I am very stuck with something I am trying to build where users load a JPG file from a template library, enter some text, select a font and font size and alignment and then they click submit. A new image is created with the user's text inserted in the correct font, size and position.
What I would like to do is to be able to wrap the form inputted text to a rectangular shape which has it's dimensions sourced from the database record relating to the template. The information I am thinking of storing is TOP co-ord, LEFT co-ord, Width and Height. This would create a rectangular shape for the text to be wrapped in.
I have a similar example of what I would like to do using Windows Forms (http://www.java2s.com/Code/CSharp/2D-Graphics/Textwrapverticalhorizontalandtrim.htm
) but I do not know how to do it using asp.Net for a website or whether I can use the same methods.
I would be very grateful if anyone can help me get the correct code for what I want to do. :)
MY CURRENT CODING
Dim bitMapImage As Bitmap = New Bitmap(Server.MapPath("/imgs/templates/MothersDay.jpg"))
Dim graphicImage As Graphics = Graphics.FromImage(bitMapImage)
graphicImage.SmoothingMode = SmoothingMode.AntiAlias
Dim oColor As System.Drawing.Color
Dim sColor As String = Request("BackgroundColor")
Dim sText As String = Request("Text")
Dim sFont As String = Request("Font")
oColor = Color.Red
oColor = Color.Green
oColor = Color.Navy
oColor = Color.Orange
oColor = Color.Black
graphicImage.DrawString("Example Text Example Text Example Text", New Font("Arial", 20, FontStyle.Bold), SystemBrushes.WindowText, New Point(100, 250))