I know, I know... there are many others posts like this. I didn't find what I was look for, let's move on.
I break a PDF into images using this GhostScript implementation for C# and then try to load each image into a Bitmap, sometimes it gives me a Parameter is not valid error
on this line:
[...]new Bitmap((Image)Image.FromFile(imagePath))[...]
Image.FromFile(imagePath)
successfully returns an Image (though I think it's returning a Bitmap) but then Bitmap's constructor gives me the error. What am I doing wrong?
P.S.
I'm casting the result to Image
because when I quick watch the result of Image.FromFile(...) it shows it as a System.Drawing.Bitmap (either way, cast, no cast, yields the same result).