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

New Post: Possible issue writing to stream

$
0
0
Your second example is writing an eps file. When you write to a stream the Format of the input stream is used. If you want to write to a different format you will have to set the Format property of your MagickImage.
using (MagickImage image2 = new MagickImage("fileSource.eps"))
{
    image2.Strip();

    // This uses the format of the input image.using (Stream fs = new FileStream("thisIsActualyAn.eps", FileMode.OpenOrCreate))
    {
        image2.Write(fs);
    }

    image2.Format = MagickFormat.Jpeg;
    using (Stream fs = new FileStream("fileDestination.jpg", FileMode.OpenOrCreate))
    {
        image2.Write(fs);
    }
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles