New topic: forcing webimageview to transfer data as JPEG and not PNG
<http://forums.realsoftware.com/viewtopic.php?t=41035> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message plim Post subject: forcing webimageview to transfer data as JPEG and not PNGPosted: Mon Oct 17, 2011 8:29 am Joined: Tue Jan 24, 2006 11:04 am Posts: 22 How do I get WebImageView to transfer image data as JPEG instead of PNG? I am loading hex encoded JPEG data from my database into a picture and then assigning that to the WebImageView. When I analyse the traffic, I see that the images are being sent as PNG and several times larger than the JPEG version would be. Dim p as Picture = Picture.FromData(DecodeHex(DecodeHex(rs.Field("image_data").StringValue))) myWebImageView.Picture = p I know that assigning a JPEG file directly to the WebImageView works. I don't know how to force the above code to use JPEG instead of PNG. Can anyone help, please? Top Thom McGrath Post subject: Re: forcing webimageview to transfer data as JPEG and not PNPosted: Mon Oct 17, 2011 10:16 am Site Admin Joined: Tue May 06, 2008 1:07 pm Posts: 940 Location: Greater Hartford Area, CT http://docs.realsoftware.com/index.php/WebPicture.Constructor(Source_as_Picture,_Format_as_String%3D%22public.png%22) Create the WebPicture object manually, specifying the data type you want your picture converted into. This will probably still cause unwanted results however, as your loading the JPEG into a Picture object is the issue. If you want to send the raw data to the browser instead, use a WebFile object. _________________ Thom McGrath - @tekcor Web Framework Architect, Real Software, Inc. Top plim Post subject: Re: forcing webimageview to transfer data as JPEG and not PNPosted: Mon Oct 17, 2011 10:50 am Joined: Tue Jan 24, 2006 11:04 am Posts: 22 Thanks Thom. I'll try as suggested and report back. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
