Hi,
-
There is a way to get height of the text, or should create a new image and get image height?
-
There is a way to set LetterSpacing of the text?
Imports ImageMagick
public class PageClass
Inherits System.Web.UI.Page
sub Page_Load(Src as Object, E As EventArgs)
Response.ContentType = "image/JPEG"
' Read from file.
Using image As New MagickImage(Server.MapPath("../img.jpg"))
drawText("50", 200, 413, 284).Draw(image)
image.Write(Response.OutputStream, MagickFormat.Jpeg)
End Using
end sub
private function drawText(ByVal text As String, ByVal fontSize As Integer, Optional ByVal x As Integer = 0, Optional ByVal y As Integer = 0) As Drawables
dim d = New Drawables()
d.FontPointSize(fontSize)
d.Font(Server.MapPath("gotham-htf-book.otf"))
d.TextAlignment(TextAlignment.Left)
d.Text(x, y + (146), text)
'd.Gravity(Gravity.Center)
'd.StrokeColor(New MagickColor(0, Quantum.Max, 0))
'd.StrokeColor(New MagickColor("yellow"))
'd.FillColor(MagickColors.SaddleBrown)
'd.FillColor(MagickColors.Orange)
'd.Ellipse(256, 96, 192, 8, 0, 360)
return d
end function
end class