Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 540
  • Last Modified:

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

<%@ 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?
1 Solution
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)
qwekovaqweAuthor Commented:
lol i kind of figured that out too yeah ;) thnx.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now