Where do the Oval buttons come from?

J

John Kotuby

Cleveland?

Hi all,
I am writing an ASP.NET 2.0 application in VB.NET. My boss doesn't like the
fact that I still use either rectangular or the default browser buttons on
my pages. He says it doesn't look like web 2.0.

He is correct (he's the boss).

Are the now-common oval (some in 3D) buttons just images or is there a way
in .NET to create them?
We have purchased some 3rd party controls from ComponentArts but I don't see
anything like that.

Failing that, are there some relatively inexpensive "button graphics"
available for download?

Thanks to all...
 
L

Larry Bud

Cleveland?

Hi all,
I am writing an ASP.NET 2.0 application in VB.NET. My boss doesn't like the
fact that I still use either rectangular or the default browser buttons on
my pages. He says it doesn't look like web 2.0.

He is correct (he's the boss).

Are the now-common oval (some in 3D) buttons just images or is there a way
in .NET to create them?
We have purchased some 3rd party controls from ComponentArts but I don't see
anything like that.

Failing that, are there some relatively inexpensive "button graphics"
available for download?

They are images. Tell him development time is longer using images as
buttons, because every time you want a text change for the button, the
image has to be recreated. Tell him he needs to buy you the $1000
Photoshop package so you can maintain this button library.
Hopefully that will cool him off.

In addition, images won't scale if a user has to enlarge the font
because of a disability.

Web 2.0? Your boss is an idiot!
 
B

Barrie Wilson

there are free buttons all over the web ... start Googling and give the guy
what he wants if he wants to pay you to do this kind of thing
 
L

Lloyd Sheen

Larry Bud said:
They are images. Tell him development time is longer using images as
buttons, because every time you want a text change for the button, the
image has to be recreated. Tell him he needs to buy you the $1000
Photoshop package so you can maintain this button library.
Hopefully that will cool him off.

In addition, images won't scale if a user has to enlarge the font
because of a disability.

Web 2.0? Your boss is an idiot!

Not wanting to start a flame war, I must say your comments are not well
founded. All you need to do is create a web page that creates a button
(lets say from an image on your website). Pass the text you want as a
querystring and then create the image on the fly and stream it to the
response. Very simple and only one button image needed.

Telling people they are idots without knowing how to fix the problem is
neither smart or helpful.

Following is working code which you can modify to your means:

Public Const imText As String = "ImageText"
Public Const imFolder As String = "ImageFolder"

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim imageFolder As String
Dim imageText As String
Dim bm As Bitmap
Dim ms As MemoryStream

imageFolder = Request.QueryString(imFolder)
imageText = Request.QueryString(imText)

' if no imageFolder is sent then create a button from a template
button
If imageFolder Is Nothing Then
bm = makeImage(imageText)
Else
bm = makeImage(imageFolder, imageText)
End If

ms = New MemoryStream
bm.Save(ms, ImageFormat.Jpeg)
Response.ContentType = "image/jgp"
Response.BinaryWrite(ms.ToArray())
End Sub

Private Function makeImage(ByVal imagetext As String) As Bitmap
Dim bm As Bitmap
Dim g As Graphics
Dim bfont As Font

Dim tsize As SizeF
'Dim imageHeight As Integer
'Dim imageWidth As Integer

bfont = New Font("Trebuchet MS", 14)

bm = New Bitmap(Server.MapPath("~/Images/YourImage.png"))

g = Graphics.FromImage(bm)
tsize = g.MeasureString(imagetext, bfont)

Dim tx As Single
Dim ty As Single

tx = (bm.Width - tsize.Width) / 2
ty = (bm.Height - tsize.Height) / 2

g.DrawString(imagetext, bfont, New SolidBrush(Color.Black), tx, ty)
g.Dispose()

Return bm

End Function

Hope this helps

LS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top