- Where Developers Learn, Share, & Build Careers
First, a small background: For the time being Further forgiveness is the long-winded nature of this introduction; However, it can help to provide an alternative solution which is not specific to the nature of the question. I have an ASP.NET MVC application that uses Embedded WinForm UserControls. These controls provide support for "narrow" on tablet PCs via the However, an image URL Problem This works, but there is a lot of overhead in this process, which is important I delay loading webpage (15 pictures take 15 seconds ... not ideal). An existing option, I decided to test it I will load each image in javascript, then use 15 seconds for 15 images is less than 3 seconds, so the image that works in IE 7/8-> Base 64 The search for the solution began. Here are some additional requirements / restrictions: I hope that I have provided enough information and I appreciate any direction you can give. Thank you. You can use any FlashCanvas, fxCanvas or excanvas libraries, which in older Internet Explorer versions Flash or simulate the canvas using VML. I believe that all of them provide the After extensive excavation (I am in the same fix) I believe that this is the only solution, it is less than writing a PHP script, which you can send to the image. Of course, the problem is that none of these three situations is true, unless there is no way to send pictures to PHP scripts: Microsoft .inux library. They are an unfortunate requirement due to an IE8 corporate standard; Otherwise, the HTML5 canvas solution will be there.
InkPicture to
& lt; PARAM & gt; Has been passed through .
and object VIEWASEXT = "true" classid = "MyInkControl.dll # MyInkControl.MyInkControl" id = "myImage" name = "myImage" runat = "server" & gt; & Lt; PARAM name = "ImageUrl" value = "http: //some-website/Content/images/myImage.png" /> & Lt; / Object & gt; The associated property in the
UserControl takes that URL, one method calls a
HttpWebRequest , and the returned image It is kept in it
InkPicture .
public image download image (string url) {image _tmpImage = null; Try {// Open a Connection HttpWebRequest _HttpWebRequest = (HttpWebRequest) HttpWebRequest.Create (url); _HttpWebRequest.AllowWriteStreamBuffering = True; // Use default credentials _HttpWebRequest.Credentials = Credential cache. Default credentials; // Request Reaction: System.Net.WebResponse _WebResponse = _HttpWebRequest.GetResponse (); // Open data stream: system. Io Stream_webstream = _WebResponse.getResponseStream (); // Change webstream to image _tmpImage = Image.FromStream (_WebStream); // CleanUp _WebResponse.Close (); } Hold (Exception Pre) {// Error Throw Before; } Return _tmpImage; }
image img = new bitmap (url) in the
UserControl file IO permissions issues (due to complete trust or not, does not work in this situation, I failed to delete
canvas and
toDataUrl () to get base64 data. After all, instead of passing the URL to
UserControl and all the leg work, I pass the base 64 data as
and lt; PARAM & gt; Then it quickly converts that data into the image.
toDataURL method from the canvas API, from which you can get an encoded representation of your image.
Uint8Array )
sendAsBinary
Comments
Post a Comment