Ask a Question related to ASP.NET General, Design and Development.
-
Jenny #1
Response.
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
Jenny Guest
-
Slow login response response on TS 03 in AD mixed mode
We upgraded our NT 4 domain to an AD mixed until we get rid of the NT 4 BDC;s after completing this upgrade users began complaining about how long... -
Response.Flush / Response.Redirect
Hi, I've had a good google and can't find anything already on this so : I'm currently trying to have a 'Page Loading' page on a site. The way... -
AW7 vs. DirectorMX for psychology experiment using response times AND response answers
Hello, I'm very new to application design, but need to develop a web based application to use at multiple schools as part of an experimental... -
Response.Write and Response.Redirect
On my Page_Load event, i need to do some validation and then either let them proceed, or display a error message and boot them back to the previous... -
James J. Foster #2
Re: Response.
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
[url]http://www.dotnetcoders.com[/url]
"Jenny" <j.malloyNO@SPAMx-mail.net> wrote in message
news:0a2901c35753$5275a690$a501280a@phx.gbl...> 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
James J. Foster Guest
-
Jenny #3
Re: Response.
Hi Karl,
thanks for the suggestion. But there is an image before the
sentence 'and place that in your' which I can't see. Can
you send it a second time?
Thanks
Jenny
the file to the>-----Original Message-----
>Haven't dealt with GDI+ in a bit..but instead of savingsave both to a file>filesystem which you are doing via:
>ob.Save(tempfilepath & "temp.jpg", Imaging.ImageFormat.Jpeg)
>
>why not save it to the response's outputstream ala:
>
>ob.save(Response.OutputStream, Imaging.ImageFormat.Jpeg)
>
>if you look at the save method, you'll see that you canResponse.OutputStream :)>and to a stream...which is exactly why there's a asave the bitmap to>
>However, you'll have to change your logic a bit. If youanything...that's>the outputstream, you won't be able to render any text oroutputted to the>because you can't have a mix of binary and text contenxtlimitation). SO what you'd>screen (just the way HTTP works...not an asp.netplace that in your>need to do is something like this:
>
><img src="mytempimage.aspx" width="130" height="30"> andthe browser in>aspx page. This'll work because each image is fetched bysimply save the>its own stream/request. Then in mytmepimage.aspx you canset your>image to the response.outputstream...you'll also want tolike?>response.contenttype accordingly..something like "umage/jpeg"
>
>Karl
>
>
>
>"Jenny" <j.malloyNO@SPAMx-mail.net> wrote in message
>news:0a2901c35753$5275a690$a501280a@phx.gbl...>> 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>>>
>> Thanks for all help
>>
>> Jenny
>
>.
>Jenny Guest



Reply With Quote

