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

New Post: Caption background color ignored

$
0
0
Your issue is that you are expecting that the background color is set to the color that you specify when you read the image but that doesn't happen at the moment. I understand that this would be logical so this will be changed in the next release of Magick.NET. This will only be changed in the MagickImage constructor that accepts a MagickColor. I will not change that in the Read method that has a color argument because that could possibly break someone their code.

For now you will need to specify the background color after you created the canvas:
MagickColor backgroundColor = new MagickColor("Purple");

using (MagickImage timestampImage = new MagickImage(backgroundColor, 352, 14))
{
  timestampImage.BackgroundColor = backgroundColor;
  timestampImage.FillColor = new MagickColor("#9900FF");
  timestampImage.Font = "Arial-Italic";
  timestampImage.FontPointsize = 12;
  timestampImage.Read("caption:As of " + DateTime.Now.ToString());
  timestampImage.Write("test.png");
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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