Does anyone know of a method for moving a system image (system.drawing.image) to a web image (webcontrols.image) control without dumping it to disk and then reading it back? I am trying to generate barcode images and display them on a web form from whence
they can be printed.
Thanks so much for pointing me in the right direction. I'd been struggling with GDI+ generic errors and writing/retrieving from disk all weekend. This is a much more elegent solution.
It turns out there is a good example of how to use an http handler to display web images in the Club Sample available from Resources on this site. [:)]
Here are two articles that shed some light on the matter:
"Dealing with Images in Content Management Systems"
"Dynamic Image Generation in ASP.Net 2.0"
I used a C# snippet from the latter, ran it through a VB converter, and revised it for my own use. Email me at my user name at WindigoSystems dot com and I will send you a copy.
BGlosser
Member
40 Points
10 Posts
How do you move a system image to a web image control in memory?
Aug 25, 2006 08:15 PM|LINK
Hi,
Does anyone know of a method for moving a system image (system.drawing.image) to a web image (webcontrols.image) control without dumping it to disk and then reading it back? I am trying to generate barcode images and display them on a web form from whence they can be printed.
Thanks for any suggestions,
Ryoushin
Member
292 Points
81 Posts
Re: How do you move a system image to a web image control in memory?
Aug 28, 2006 08:49 AM|LINK
store the stream of your image in a session/application[identified] object, then render that stream using a generic handler (*.ashx)
<asp:Image runat="server" ImageUrl="myImgHandler.ashx?srcID={...data to retrieve the stream object...}" />
In your handler just flush your image and, eventually, destroy the session/application object.
Hope it helps.
BGlosser
Member
40 Points
10 Posts
Re: How do you move a system image to a web image control in memory?
Aug 28, 2006 08:07 PM|LINK
Hi,
Thanks so much for pointing me in the right direction. I'd been struggling with GDI+ generic errors and writing/retrieving from disk all weekend. This is a much more elegent solution.
It turns out there is a good example of how to use an http handler to display web images in the Club Sample available from Resources on this site. [:)]
noamw
Member
175 Points
37 Posts
Re: How do you move a system image to a web image control in memory?
Sep 21, 2006 09:21 PM|LINK
I can't find the sample... could you post a link?
thanks!
.NET Developer
noamwolf.com
BGlosser
Member
40 Points
10 Posts
Re: How do you move a system image to a web image control in memory?
Sep 21, 2006 10:23 PM|LINK
Sure..I think I found it in the Club Site sample.
http://www.asp.net/downloads/starterkits/
I also found a variation on that by googling the web. It stores and retrieves images from cache memory which works very well.
noamw
Member
175 Points
37 Posts
Re: How do you move a system image to a web image control in memory?
Sep 22, 2006 03:09 AM|LINK
Thanks!
Sorry to be repetitious but could you post a link for the cache memory solution?
thanks again!
.NET Developer
noamwolf.com
BGlosser
Member
40 Points
10 Posts
Re: How do you move a system image to a web image control in memory?
Sep 22, 2006 02:32 PM|LINK
Here are two articles that shed some light on the matter:
"Dealing with Images in Content Management Systems"
"Dynamic Image Generation in ASP.Net 2.0"
I used a C# snippet from the latter, ran it through a VB converter, and revised it for my own use. Email me at my user name at WindigoSystems dot com and I will send you a copy.
Hope this helps!