Drawing images in asp.net

  • Thread starter Thread starter Cory J. Laidlaw, Beyond01.com
  • Start date Start date
C

Cory J. Laidlaw, Beyond01.com

Hi,

I am trying to draw a simple graph using ASP.NET without using a 3rd party
control.

I only want to draw a simple horizontal bar chart, save it to a JPG and
render it on my web form.

There are several articles using GDI(?) for this, but they all relate to
windows forms, not web forms. My attempts to convert it to using on a web
form aren't working too well.

Does anyone have an example of how to do this from ASP.NET? Help greatly
appreciated! Thanks!!

Cory

P.s. Here is my first shot at a prototype. as you can see, nothing happens...

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load

Dim bmp As New Bitmap(200, 200)
Dim fg As Graphics = Graphics.FromImage(bmp)

fg.FillRectangle(Brushes.Aqua, 50, 50, 100, 100)

bmp.Save("Test.bmp")

Image1.ImageUrl = "test.bmp"


End Sub
 
Cory,

Creating yourself images on ASPNet is not as simple as in Windows Forms.

Every image in HTML has its own url, you can see that sometimes in your
browser.

This is a method how you can do it.

http://www.vb-tips.com/ServerClock.aspx

I think this is an outdated example I made some years ago.

If I would make this example new, then I certainly would try to do it with
Silverlight

Cor




"Cory J. Laidlaw, Beyond01.com"
 
Cory,

Creating yourself images on ASPNet is not as simple as in Windows Forms.

Every image in HTML has its own url, you can see that sometimes in your
browser.

This is a method how you can do it.

http://www.vb-tips.com/ServerClock.aspx

I think this is an outdated example I made some years ago.

If I would make this example new, then I certainly would try to do it with
Silverlight

Cor




"Cory J. Laidlaw, Beyond01.com"
 
Very good. I'll check these soltuions out.

Thanks both to you Patrice and Cor for your help! :)

Cory
 
Very good. I'll check these soltuions out.

Thanks both to you Patrice and Cor for your help! :)

Cory
 
Cor Ligthert said:
Creating yourself images on ASPNet is not as simple as in Windows Forms.

Every image in HTML has its own url, you can see that sometimes in your
browser.

This is a method how you can do it.

http://www.vb-tips.com/ServerClock.aspx

I think this is an outdated example I made some years ago.

If I would make this example new, then I certainly would try to do it with
Silverlight

Well, the sample could be optimized easily by changing the image format from
bitmap to GIF or PNG, for example. This would reduce the amount of data
which has to be transferred.
 
Cor Ligthert said:
Creating yourself images on ASPNet is not as simple as in Windows Forms.

Every image in HTML has its own url, you can see that sometimes in your
browser.

This is a method how you can do it.

http://www.vb-tips.com/ServerClock.aspx

I think this is an outdated example I made some years ago.

If I would make this example new, then I certainly would try to do it with
Silverlight

Well, the sample could be optimized easily by changing the image format from
bitmap to GIF or PNG, for example. This would reduce the amount of data
which has to be transferred.
 
Back
Top