I'm thinking that you want to stream the image down as opposed to saving it
to disk. What you can do is create a separate page that just streams down
the bytes for an image. Create a new .aspx page and remove all the HTML
content. Add this code to the page_load event:
Bitmap ob = new Bitmap(130, 30);
Graphics banner = Graphics.FromImage(ob);
ob.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
Next, in the page with your ImageButton control, set the source of the
ImageButton to the page you created above. For example, if your page was
called webform2.aspx, you'd have:
ImageButton1.ImageUrl = "webform2.aspx";
You can customize with parameters or whatever you need in order to generate
an appropriate image for that particular user.
--
James J. Foster, DotNetCoders
http://www.dotnetcoders.com
"Jenny" <j.malloyNO@SPAMx-mail.net> wrote in message
news:0a2901c35753$5275a690$a501280a@phx.gbl...[color=blue]
> My application generates images dynamic. These images are
> then used for an image button like in the beneath.
>
> Dim ob As Bitmap = New Bitmap(130, 30)
> Dim banner As Graphics = Graphics.FromImage(ob)
>
> Dim tempfilepath As String = System.IO.Path.GetTempPath
> ob.Save(tempfilepath & "temp.jpg",
> Imaging.ImageFormat.Jpeg)
>
> image_button.ImageUrl = tempfilepath & CType(i, String) &
> "temp.jpg"
>
> Is it also possible to add this graphic with the help of
> Response.BinaryWrite etc.? If yes how must the code luck like?
>
> Thanks for all help
>
> Jenny[/color]