text to image :( not working... an example page...

Posted on 2005-03-19
Medium Priority
Last Modified: 2011-10-03
<%@ Page Language="VB" Debug="True" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<%@ Import Namespace="System.Drawing.Text" %>
' Declare Vars
Dim objBMP        As System.Drawing.Bitmap
Dim objGraphics   As System.Drawing.Graphics
Dim objFont       As System.Drawing.Font

' Create new image - bitmap
objBMP = New Bitmap(100, 30)

' Create a graphics object to work with from the BMP
objGraphics = System.Drawing.Graphics.FromImage(objBMP)

' Fill the image with background color

' Set anti-aliasing for text to make it better looking
objGraphics.TextRenderingHint = TextRenderingHint.AntiAlias

' Configure font to use for text
objFont = New Font("Arial", 16, FontStyle.Bold)

' Write out the text
objGraphics.DrawString("ASP 101", objFont, Brushes.White,  3, 3)

' Set the content type and return the image
Response.ContentType = "image/GIF"
objBMP.Save(Response.OutputStream, ImageFormat.Gif)

' Kill our objects

generates an error:

Active Server Pages error 'ASP 0221'
Invalid @ Command directive
/search/Default.asp, line 1
The specified 'Page Language="VB" Debug="True" ' option is unknown or invalid.

how do i get this to work?
Question by:qwekovaqwe
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

pheine earned 160 total points
ID: 13585549
actually, this is an ASP.NET not an ASP page.

make sure you installed microsoft .net framework (dotnetfx) and name the file default.aspx (aspx is the default suffix for .net webpages)

Author Comment

ID: 13588414
lol i kind of figured that out too yeah ;) thnx.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question