|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
I made a simple Wndows application in VS2005. A form with a button and a picturebox. >From a public webservice i get a bytearray which i put in a stream and place it in thepicturebox. Dim xx As New System.IO.MemoryStream(yy) PictureBox1.Image = Image.FromStream(xx) PictureBox1.SizeMode = PictureBoxSizeMode.CenterImage Now i want to do the same in a webapplication, but i can't find a picturebox, only a image object. How can i put the incomming bytearray in a image? Thanks, Jurgen
Show quote
Hide quote
"JTE" <jurgen.tess***@chello.nl> schrieb: You can save the byte array to an image file on the server and make the > I made a simple Wndows application in VS2005. A form with a button and > a picturebox. >>From a public webservice i get a bytearray which i put in a stream and > place it in the > picturebox. > > Dim xx As New System.IO.MemoryStream(yy) > PictureBox1.Image = Image.FromStream(xx) > PictureBox1.SizeMode = PictureBoxSizeMode.CenterImage > > Now i want to do the same in a webapplication, but i can't find a > picturebox, only a image object. > How can i put the incomming bytearray in a image? 'img' element's 'src' attribute point to the image file on the server. Popular browsers like Microsoft Internet Explorer do not support embedding of image data into HTML pages. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> Hello Herfried K. Wagner [MVP],
Actually, IE does support embedded images in MHT (web archive) files. I'm not recommending this, just a comment. -Boo Show quoteHide quote > "JTE" <jurgen.tess***@chello.nl> schrieb: > >> I made a simple Wndows application in VS2005. A form with a button >> and a picturebox. >> >>> From a public webservice i get a bytearray which i put in a stream >>> and >>> >> place it in the >> picturebox. >> Dim xx As New System.IO.MemoryStream(yy) >> PictureBox1.Image = Image.FromStream(xx) >> PictureBox1.SizeMode = PictureBoxSizeMode.CenterImage >> Now i want to do the same in a webapplication, but i can't find a >> picturebox, only a image object. >> How can i put the incomming bytearray in a image? > You can save the byte array to an image file on the server and make > the 'img' element's 'src' attribute point to the image file on the > server. Popular browsers like Microsoft Internet Explorer do not > support embedding of image data into HTML pages. > "GhostInAK" <ghosti***@gmail.com> schrieb: That's true, but I was referring to the 'data' pseudo protocol used in HTML > Actually, IE does support embedded images in MHT (web archive) files. I'm > not recommending this, just a comment. and supported by some user agents. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Herfried K. Wagner [MVP] wrote:
> "GhostInAK" <ghosti***@gmail.com> schrieb: Thank you both for the input !> > Actually, IE does support embedded images in MHT (web archive) files. I'm > > not recommending this, just a comment. > > That's true, but I was referring to the 'data' pseudo protocol used in HTML > and supported by some user agents. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/>
Show quote
Hide quote
"JTE" <jurgen.tess***@chello.nl> wrote in message A similar approach to what Herfried suggested would be to use an news:1157115275.744314.153140@p79g2000cwp.googlegroups.com... > Hi everybody, > > I made a simple Wndows application in VS2005. A form with a button and > a picturebox. >>From a public webservice i get a bytearray which i put in a stream and > place it in the > picturebox. > > Dim xx As New System.IO.MemoryStream(yy) > PictureBox1.Image = Image.FromStream(xx) > PictureBox1.SizeMode = PictureBoxSizeMode.CenterImage > > Now i want to do the same in a webapplication, but i can't find a > picturebox, only a image object. > How can i put the incomming bytearray in a image? > > Thanks, > > Jurgen > HttpHandler. I have attached a sample HttpHandler for images ... to use: 1.) Add the attached class to your project. 2.) Add an image to the default web page. 3.) Set the ImageUrl property of the image control to "MyImage.aspx?text=SomeText&FileName=Somefilenamewithpngext.png". 4.) Open your web config file and add the following in the <system.web> section: <httpHandlers> <add verb="*" path="MyImage.aspx" type="YourNamespaceHere.MyImageHandler,YourWebProjectAssemblyNameHere" /> </httpHandlers> 5.) Build the project and open the web page you placed the image onto. Using an HttpHandler allows you to pull an image from practically any storage area the ASPNET (or authenticating account) has access to and stream it to the client, regardless of the web browser the user is using (not text based though, of course). Using this direct method, you can expand upon it to stream ANY file to the client, and you are not limited to just images. Currently, we use HttpHandlers for streaming PDF files that were Crystal Report reports exported to PDF files. We use the HttpHandler for images stored in our SQL Server databases. This prevents the clutter of images stored on the hard drive in folder structure and also allows stricter access based on our security system (custom-built) and allows for DBA's to manage the images instead of our deployment people (which just happen to be our DBA's lol). With the HttpHandler I wrote, you can set the text to anything you want as well as the name of the file. In the ImageUrl property, set the Text and FileName query items to what you wish, and the image will display the text. Another cool feature is if you navigate directly to your web site and instead of the aspx page, put MyImage.aspx?Text=<some text>&FileName=<some filename>.png, it will prompt to open the file in your registered PNG file viewer! :) HTH, Mythran [attached file: MyImageHandler.vb]
For Next Loop - Manual Might Be Wrong
API FindFirstFile\FindNextFile vs GetFiles How to Type cast ArrayList items to class objects VB 2005 with Active Directory "If" statement asking for integer Application quit after button click use varible value in include file Strange Datagrid Behavior How to use Resource files in VS 2005? EventType clr20r3 system.io.filenotfoundexception |
|||||||||||||||||||||||