looks like that attachement got stripped. Oh, well, all the better I
Suppose. Here is the code from the code behind on the generate.aspx file.
generate.aspx is just a blank file so it should be easy to re-create it.
--------------------------
Imports System
'Imports System.Collections
'Imports System.ComponentModel
'Imports System.Data
Imports System.Drawing
Imports System.Drawing.Imaging
'Imports System.Web
'Imports System.Web.SessionState
'Imports System.Web.UI
'Imports System.Web.UI.WebControls
'Imports System.Web.UI.HtmlControls
Namespace IRMWeb
Public Class Generator
Inherits Web.UI.Page
Private Sub Generator_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim objBitmap As Bitmap
Dim objGraphics As Graphics
Dim f As Font = New Font("Arial", 10, FontStyle.Regular)
Dim StrSize As System.Drawing.Size
Dim strText As String = Request("x")
If (strText.ToString.Length = 0) Then
' Create an Empty Image of 12 x 12 white
objBitmap = New Bitmap(12, 12)
objGraphics = Graphics.FromImage(objBitmap)
objGraphics.Clear(Color.White)
Response.End()
Return
Else
strText = strText.ToUpper
' Create Bitmap
objBitmap = New Bitmap(12, 12)
objGraphics = Graphics.FromImage(objBitmap)
StrSize = objGraphics.MeasureString(strText, f).ToSize()
' Initialize Graphics Class
objBitmap = New Bitmap(Convert.ToInt32(StrSize.Width -
(StrSize.Width * 0.07)), StrSize.Height)
objGraphics = Graphics.FromImage(objBitmap)
objGraphics.Clear(Color.White)
objGraphics.DrawString(strText, f, Brushes.Blue, 0, 0)
' Display Bitmap
Response.Buffer = True
Response.Clear()
objBitmap.Save(Response.OutputStream, ImageFormat.Gif)
Response.Flush()
Response.End()
End If
End Sub
End Class
End Namespace
-----------------------------
"Bob Boran" <mc*******@hotmail.com> wrote in message
news:#B**************@TK2MSFTNGP11.phx.gbl...
Here is a little aspx file I wrote about a year ago. It generates a small
image based on a text string passed to the page.
to use it you might do something like this on the page
<img src="generator.aspx?x=Bob">
this tag would generate an image on the fly that just says Bob
"CGuy" <cg**@csharp.net> wrote in message
news:eq**************@tk2msftngp13.phx.gbl... Hi Gurus,
I have a rather unique requirements in my ASP.NET application - I
need to create image buttons on the fly while rendering a page.
The scenario is like this - the user can enter some text (max 10 chars) in a page and when he saves the information, the next page should
display an imagebutton that has the text which the user entered (in the previous
page).
Please help me with your valuable insights.
Regards,
CGuy