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

New Post: Read Pdf image using Magick.NET-x86.dll, StackOverflow exception?

$
0
0
I am new to Magick.net. I found it last week.
What I am trying to do is reading a image of a pdf file.

Here is my code:
  public static System.Drawing.Bitmap GetPreview(string fn)
    {
        System.Drawing.Bitmap bmp;


        MagickReadSettings settings = new MagickReadSettings();
        settings.Density = new MagickGeometry(100, 100);
        settings.ColorSpace = ColorSpace.sRGB;
        settings.Format = MagickFormat.Jpeg;

       using (MagickImage coverPage = new MagickImage())
        {
           coverPage.Format = MagickFormat.Jpeg;

            coverPage.Quality = 50;
            coverPage.Read(fn+"[0]", settings);

           using (MemoryStream m = new MemoryStream())
            {
                 bmp = coverPage.ToBitmap(System.Drawing.Imaging.ImageFormat.Jpeg);
           }
     }

        return bmp;
    }
This code is ok for Magick.NET-x64.dll. But somehow if I set my platform to x86 and using Magick.NET-x86.dll, I got System.StackOverflowException when it executes
coverPage.Read(fn+"[0]", settings);

Any idea?

Thank you

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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