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

New Post: Creating MagickImage with Width Only and Using Caption to Size Image Height Automatically

$
0
0
It is probably the easiest to use the MagickReadSettings class for this. Your command would translate to this:
using (MagickImage image = new MagickImage())
{
  MagickReadSettings readSettings = new MagickReadSettings()
  {
    Width = 980, // -size 980x
    Font = "Arial", // -font Arial
    FontPointsize = 54, // -pointsize 54
    BackgroundColor = MagickColors.Transparent, // -background transparent
    FillColor = MagickColors.Black // -fill black
  };

  // You will need to read the text yourself. The @ syntax is a security// issue and is disabled by defaultstring caption = File.ReadAllText("pokemon.txt");

  image.Read("caption:" + caption, readSettings); // caption:"@pokemon.txt"
  image.Write("rofl_arial.png"); // rofl_arial.png
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles