Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Text Height, Letter Spacing

$
0
0
Hi,
  1. There is a way to get height of the text, or should create a new image and get image height?
  2. There is a way to set LetterSpacing of the text?
Thanks!
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

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>