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

New Post: Custom text on gif

$
0
0
Without seeing your input image I am guessing that you have your words on a colored background. I am thinking that because of your other post here: https://magick.codeplex.com/discussions/661233. Below is an example of how you could create the image you want:
string word = "Hello";

using (MagickImage background = new MagickImage("background.png"))
{
  using (MagickImageCollection collection = new MagickImageCollection())
  {
    for (int i = 1; i < word.Length + 1; i++)
    {
      MagickImage frame = background.Clone();

      frame.AnimationIterations = 1;
      frame.AnimationDelay = 100;

      new Drawables()
        .FillColor(MagickColors.Fuchsia)
        .Font("Times New Roman")
        .FontPointSize(90)
        .Text(50, 200, word.Substring(0, i))
        .Draw(frame);

      collection.Add(frame);
    }

    // This will reduce the size of your file.
    collection.Optimize();

    collection.Write("test.gif");
  }
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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