CODEDIGEST
Home » FAQs
Search
 

Technologies
 

How to Generate Image on the fly from a string in C#, ASP.Net ?
Submitted By Satheesh Babu B
On 1/26/2010 12:06:20 AM
Tags: Interview Questions,ASP.Net  

How to Generate Image on the fly from a string in C#, ASP.Net ?

Convert Text to Image in C# Asp.net Dynamically

There are situations where we need to display some important strings like email IDs or verification codes as a image instead of text in ASP.Net pages. By doing like this, we can prevent some screen readers to read the content or some spywares to read the email id displayed on the page. Hence, to secure the string text we can display it as a image instead of text.

 

Well, this can be achieved by Graphics class in System.Drawing namespace and by using HttpHandler in ASP.Net.

 

The below code snippet will help you to do that,

Generate image from a string in C#. ASP.Net

Recent FAQs
  • View All FAQs..