.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 11th, 2013, 09:53 AM
RobinR RobinR is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: New Jersey
Posts: 99 RobinR User rank is Private First Class (20 - 50 Reputation Level)RobinR User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 10 h 51 m 12 sec
Reputation Power: 11
Exclamation ASP.Net Creating Dynamic Images

I got the following tutorial for creating dynamic images from sitepoint and simply changed jpeg to gif. FillRectangle gives you a standard rectangle.

Does ASP.Net does have the following similar features as Adobe Fireworks:
Can you make a rounded rectangle?
Can you specify a matte?
Can you specify that you want that part of the button that doesn’t have color to be transparent?
Can you have a bevel and emboss effect to make a button have depth?

If any of these things are possible, how would they be done? Can you recommend a tutorial or a book that would help?

Thanks,

Robin
**************************************************

[code]
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Text" %>
<%@ Import Namespace="System.Drawing.Imaging" %>

<script language="VB" runat="server">

Sub Page_Load(sender As Object, e As EventArgs)

If Page.IsPostBack Then

Dim oBitmap As Bitmap = New Bitmap(468, 60)
Dim oGraphic As Graphics = Graphics.FromImage(oBitmap)
Dim oColor As System.Drawing.Color

Dim sColor As String = Request("BackgroundColor")
Dim sText As String = Request("Text")
Dim sFont As String = Request("Font")

Select Case sColor
Case "red"
oColor = Color.Red
Case "green"
oColor = Color.Green
Case "navy"
oColor = Color.Navy
Case "orange"
oColor = Color.Orange
Case Else
oColor = Color.Gray
End Select

Dim oBrush As New SolidBrush(oColor)
Dim oBrushWrite As New SolidBrush(Color.White)

oGraphic.FillRectangle(oBrush, 0, 0, 468, 60)
oGraphic.TextRenderingHint = TextRenderingHint.AntiAlias

Dim oFont As New Font(sFont, 13)
Dim oPoint As New PointF(5F, 5F)

oGraphic.DrawString(sText, oFont, oBrushWrite, oPoint)


'Response.ContentType = "image/gif"
'oBitmap.Save (Response.OutputStream, ImageFormat.gif)

oBitmap.Save(Server.MapPath("gen_img.gif"), ImageFormat.gif)

Response.Write("View the generated image <a target=""_blank"" href=""gen_img.gif"">here</a>")

End If



End Sub

</script>

<form runat="server">
<asp:TextBox runat="server" id="Text" />

<br><br>

<asp:dropdownlist runat="server" id="BackgroundColor">
<asp:ListItem Value="red">Red</asp:ListItem>
<asp:ListItem Value="green">Green</asp:ListItem>
<asp:ListItem Value="navy">Navy</asp:ListItem>
<asp:ListItem Value="orange">Orange</asp:ListItem>
</asp:dropdownlist>

<asp:dropdownlist runat="server" id="Font">
+ <asp:ListItem Value="Arial">Arial</asp:ListItem>
<asp:ListItem Value="Verdana">Verdana</asp:ListItem>
<asp:ListItem Value="Courier">Courier</asp:ListItem>
<asp:ListItem Value="Times New Roman">Times New Roman</asp:ListItem>
</asp:dropdownlist>

<br><br>

<asp:Button runat="Server" id="SubmitButton" Text="Generate Image" />


</form>
[code]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > ASP.Net Creating Dynamic Images

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap