Development – Leet 4 Life

Software Development Code Samples and More

Skip to: Content | Sidebar | Footer

Tag: Conversion

Displaying TIFF Images in ASP.NET

3 October, 2012 | ASP.NET, C#. NET | By: Michael Adams

I needed to display TIFF images that were stored in the database. Unfortunately it is not as simple as just setting the MIME Type and writing out the binary. The reason for this is because the TIFF image type is only supported in IE currently. So I asked Google and the overwhelming response I saw was to convert the TIFF into another image type and then write out the binary to the response stream. Here is my take on the solution: Written in C# (the image is sent via a Generic Handler hence the “context.Response”): It should be noted that [Read More…]

Converting a Value Back to an Enumeration

23 March, 2012 | C#. NET | By: Michael Merrell

Stored enumeration values need a way to be converted back to to their enumeration type.  In a previous post I go into detail on how to get the values on an enumeration and return them in a usable data format.  This is great if we want to store the value in the database, but when you pull the value back out you need to have a way to convert it back into something usable.   There are two methods defined below, both take in a Type parameter and then a value parameter.  The first method below also takes in a default value in [Read More…]