Thread: .NET Question
View Single Post
Old 02-19-2008, 09:34 PM   #6 (permalink)
danparks
Junior Member
 
danparks's Avatar
 
Join Date: 02-19-08
Posts: 12
iTrader: 0 / 0%
Latest Blog:
None

danparks is liked by many
Quote:
Originally Posted by searchbliss View Post
I can create images with text on the fly with .NET, but I can't add text effects (reflections. shadows. etc.). Any ideas how to do this? Here are the namespaces I am using.

Code:
<%@ Page Language="VB" Debug="True" %> <%@ Import Namespace="System.Drawing" %> <%@ Import Namespace="System.Drawing.Imaging" %> <%@ Import Namespace="System.Drawing.Text" %>
Thanks!
Your namespaces are correct. I haven't done text effects, but for the general part of creating the image and drawing text to it the following works to draw text in a rectangle (sorry, not a complete answer, but it might be of some help):

Bitmap bitmap = new Bitmap(100, 50);

Graphics gr = Graphics.FromImage(bitmap);

gr.FillRectangle(Brushes.LightGray, new Rectangle(0, 0, bitmap.Width, bitmap.Height));

gr.DrawString("Hello", font, Brushes.Black, (float)10, (float)20);

Dan
__________________
MadBeeTech.com | Hosting | Website builder | Sell products | Sell digital downloads | Include a membership area
danparks is offline   Reply With Quote