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

New Post: How to set tEXT chunk in PNG files?

$
0
0
You can add tEXT chunks with the SetAttribute method of MagickImage:
using (MagickImage input = new MagickImage("logo:"))
{
  input.SetAttribute("Magick.NET", "Rules");

  using (MemoryStream memStream = new MemoryStream())
  {
    input.Write(memStream, MagickFormat.Png);
    memStream.Position = 0;

    using (MagickImage output = new MagickImage(memStream))
    {
      string rules = output.GetAttribute("Magick.NET");
      Console.WriteLine(rules);
    }
  }
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles