user3598321
user3598321

Reputation: 105

The type initializer for 'ImageMagick.Types' threw an exception

I have just installed a Magick.net from the nuget and codeplex. I just want to write a sample application for compressing an image file by reducing its quality and DPI.

As per the little documentation which is available at codeplex, I written the below snippet.

MagickNET.Initialize(@"<<myPath>>\Magick.NET-x86.xml");

 using (MagickImage mImage = new MagickImage(txtSourceImage.Text.Trim()))
                    {
                        mImage.Quality = 33;
                        mImage.Depth = 8;
                        mImage.Density = new MagickGeometry(850, 550);
                        mImage.Write(tempFilePath);
}

it gives me an error, "The type initializer for 'ImageMagick.Types' threw an exception"
Please any one help me. What is wrong here ?

Upvotes: 0

Views: 1474

Answers (1)

David
David

Reputation: 91

to: 'user3598321': About using the System.Drawing... - Have you seen the small note at the bottom of page https://msdn.microsoft.com/en-us/library/system.drawing.aspx ? You should move back to MagickNET again... ;-)

enter image description here

Upvotes: 1

Related Questions