![]() I honestly still don't know the reason for that. ![]() basically crashing the application on the first "page two". The issue was with the SelectActiveFrame method, which - after working properly the first frame - was costantly raising a Generic GDI+ Error when dealing with each subsequent frame/page. Despite the web is full of examples identical to this, I couldn't get it working with a single multi-page TIFF file - and I had a whole lot of them. This is a pretty standard way to deal with multi-page (or multi-frame) image files: as we can see, it all depends on the GetFrameCount and SelectActiveFrame GDI+ methods: ok, we might say that the second is utterly horrible for the way it works (internal pointers = bad), but at least it does the job. I tried to open the file and cycling through the frames/pages using the SelectActiveFrame method, following the official MSDN guidelines in the following way: However, if you've stumbled upon this post, it probably means that you had the same issue I experienced a couple weeks ago when trying to deal with multi-page TIFF files. It basically is the Rickroll of error messages, to say the least. When working with GDI+, you will have the pleasure to be struck by this dreadful error in a number of different ways: if you're a seasoned developer, you know what it feels like if you happen to be a newcomer, you will learn to hate it soon enough. Which basically means: we were too lazy to write some better return code, so just live with that and do your best to figure it out. However, if you had the misfortune of working with it at least once, you probably know that the worst thing about GDI+ is the nasty and opaque error messages it often gives when things go wrong. As a matter of fact, it kinda sucks in a number of ways: poor performances, bad documentation, lots of memory/compatibility issues and so on. ![]() If you're into image processing using ASP.NET you're probably well aware of what GDI+ is: in case you're not, here it is in few words: a class-based API to handle graphics and formatted text, interacting with device drivers on behalf of applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |