![]() And as we’ll see, System.Drawing works in medium trust whereas does not. If you use it today and are satisfied with it, there probably isn’t any reason why you should change your code. But used reasonably and correctly, it’s an API that really doesn’t pose any serious problem and that is fairly safe. Most of the problems I’ve seen were due to improper resource management (not freeing handles and similar bugs) or to abuse of the API (resizing gigapixel images for example). My own photo album uses it and I’ve never had a problem with it. NET framework, there has been a third possibility that will be the topic of this post.īefore we look at that, let’s put things in perspective: there are LOTS of applications and components out there that are using GDI+ (or more accurately its System.Drawing managed code expression) and they work just fine. I’m also not sure hoe fast managed code could do this sort of heavy pixel lifting. If you do, by all means drop me a comment and I’ll update the post. There might already be some purely managed image manipulation components out there that could replace System.Drawing, but I don’t know of one. There used to be two: using interop with native APIs (which won’t work in medium trust) or writing your own image manipulation library from scratch. But when you need to generate thumbnails from managed code, what other choices do you have? Kind of scary, isn’t it? Nobody likes diminished performance and run-time exceptions. ![]() Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions. But there is just this one sentence at the bottom of the documentation:Ĭlasses within the System.Drawing namespace are not supported for use within a Windows or ASP.NET service. I and many others have written about resizing images using GDI+, or rather its. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |