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

x
  • 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
objGraphics.Clear(Color.Green)

' 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
objFont.Dispose()
objGraphics.Dispose()
objBMP.Dispose()
%>




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

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