Wednesday, March 28, 2012

Where do the Oval buttons come from?

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...On Nov 6, 11:30 am, "John Kotuby"
<JohnKot...@.discussions.microsoft.comwrote:

Quote:

Originally Posted by

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!
"Larry Bud" <larrybud2002@.yahoo.comwrote in message
news:1194367352.134958.69120@.k79g2000hse.googlegro ups.com...

Quote:

Originally Posted by

On Nov 6, 11:30 am, "John Kotuby"
<JohnKot...@.discussions.microsoft.comwrote:

Quote:

Originally Posted by

>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?


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
"Larry Bud" <larrybud2002@.yahoo.comwrote in message
news:1194367352.134958.69120@.k79g2000hse.googlegro ups.com...

Quote:

Originally Posted by

On Nov 6, 11:30 am, "John Kotuby"
<JohnKot...@.discussions.microsoft.comwrote:

Quote:

Originally Posted by

>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!
>


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
Thanks Lloyd (and Barrie),
I appreciate the help...
and so will my boss.

"Lloyd Sheen" <a@.b.cwrote in message
news:%23NtFrkKIIHA.1188@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

>
"Larry Bud" <larrybud2002@.yahoo.comwrote in message
news:1194367352.134958.69120@.k79g2000hse.googlegro ups.com...

Quote:

Originally Posted by

>On Nov 6, 11:30 am, "John Kotuby"
><JohnKot...@.discussions.microsoft.comwrote:

Quote:

Originally Posted by

>>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!
>>


>
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

0 comments:

Post a Comment