web 2.0

ASP.NET(vb.net) & Create Image

ASP.NET(vb.net) & Create Image - The in this tutorial, you’ll learn and example scripts how to Create Image  using by ASP.NET scripts.

ShotDev Focus:
- ASP.NET(vb.net) & Create Image

Example

AspNetCreateImages.aspx

<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<%@ Page Language="VB" %>
<script runat="server">

Sub Page_Load(sender As Object, e As EventArgs)
Dim intWidth,intHeight As Integer
Dim FileName As String
intWidth =     400
intHeight = 200
FileName = "MyImages/Images.jpg"

Dim objBitmap As Bitmap = New Bitmap(intWidth, intHeight)
Dim objGraphic As Graphics = Graphics.FromImage(objBitmap)
objGraphic.FillRectangle(Brushes.Maroon, 0, 0, intWidth, intHeight)

'*** Save As ***'
objBitmap.Save(Server.MapPath(FileName), ImageFormat.jpeg)

'*** Close ***'
objGraphic.Dispose()

'*** Nothing ***'
objBitmap = Nothing
objGraphic = Nothing

'*** View Images ***'
Me.imgPicture.ImageURL = FileName

End Sub

</script>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Image id="imgPicture" runat="server" />
</form>
</body>
</html>

Screenshot

ASP.NET(vb.net) & Create Image
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.