load

Load a BitmapSource and save using the same name in WPF -> IOException

旧街凉风 提交于 2019-11-28 08:07:11
问题 When I try to save a BitmapSource that I loaded earlier, a System.IO.IOException is thrown stating another process is accessing that file and the filestream cannot be opened. If I only save whithout loading earlier, everything works fine. The loading code: BitmapImage image = new BitmapImage(); image.BeginInit(); image.UriSource = uri; if (decodePixelWidth > 0) image.DecodePixelWidth = decodePixelWidth; image.EndInit(); the saving code: using (FileStream fileStream = new FileStream(Directory

Detect multiple images load event

随声附和 提交于 2019-11-28 07:58:23
问题 I'm wondering if there is a way to detect load event of multiple images (particularly, a function should execute when the last image in a given set has completed loading). For instance, an user clicks on a link and lighbox appears with 10 images. When all images have loaded, loading bar should disappear. jQuery(".lightbox-image").each(function(){ var image = jQuery(this); jQuery('<img />').attr('src', image.attr('src')).load(function(){ hideLoadingBar(); }); }); This unfortunately triggers

Simple way to save and load data Visual Basic

家住魔仙堡 提交于 2019-11-28 07:42:04
I was wondering what is the easiest way to save and load data through different forms in vb. I just want to save 3 textbox.text that a user saves and be able to load it on a different form. The simplest option would be to save them to a simple delimited text file. For instance, this would save the values in a pipe-delimited file: File.WriteAllText("C:\Data.txt", String.Join("|", new String() {TextBox1.Text, TextBox2.Text, TextBox3.Text})) And this would read it in: Dim values() as String = File.ReadAllText("C:\Data.txt").Split("|"c) TextBox1.Text = values(0) TextBox2.Text = values(1) TextBox3

Load event for iFrame not fired in IE

点点圈 提交于 2019-11-28 07:23:26
Why is the load event not fired in IE for iFrames? Please take a look at this example . Work perfectly as expected in FF and Chrome, but IE fails. I think for iframes in Internet Explorer you can't set that event handler (onload) programmatically, you need to specify it in your markup. Something like: <iframe id="myFrame" onload="myFunction();"></iframe> Otherwise IE is just going to ignore the function. IE might have already loaded the content (and fired the event) before you add the handler. I found that when I statically specified the iframe src attr, and added $(x).load event handlers via

jQuery how to load some json records into a form fields?

时间秒杀一切 提交于 2019-11-28 07:05:12
i have a json file: { "data": "Click", "size": "Here" } and a form: <form> First name: <input type="text" name="firstname" /><br /> Last name: <input type="text" name="lastname" /> </form> i was wondering what is the correct sintax for loading multiple json records into multiple form elements?? Something like a form that u want to u want to modify and the values get queered into those fields i know i can use: $getJSON('link_to_json_file' function() { }); but i'm stuck here thanks William W. Doyle Or if your data return was fieldname value pairs like: {"firstname" : "John", "lastname" : "Doe"}

using jquery ajax to load info from database

人盡茶涼 提交于 2019-11-28 06:21:11
问题 Problem I tried using the following // Start method 1 var grbData = $.ajax({ type : "GET", url : "http://grb.sonoma.edu:81/getgrbs.php", data : "start=0&perPage=3"}).responseText; $("#ajaxDiv").html(grbData); // End method 1 // Start method 2 $.get("getgrbs.php", { start : 0, perPage : 3}, function(data) { $("#tst").html(data); }, "html"); // End method 2 on this page: http://grb.sonoma.edu:81/paging.php to load data from a database. Method 1 only appears to work in IE8 but only after the

How do you make jQuery bind events to elements loaded via Ajax?

烂漫一生 提交于 2019-11-28 06:15:30
问题 I'm using the .load() function to load a section of html that has some jQuery functionality that is bound to a certain class. =/ thoughts? 回答1: Use live events: $('.className').live(function(event) { ... } jQuery keeps a repository of all live selectors such as .className in this case. And it adds a handler to the document to listen for events that bubble up to the document. This special handler then basically runs through all the live selectors and forwards the event to those elements that

Jquery Multiple load in a DIV

我是研究僧i 提交于 2019-11-28 06:05:00
Here is my code $('#right').load('textes.html #nicolas'); $('#right').load('textes.html #antoine'); the problem is that the content of the div antoine overwrite in the right div the content load by the div nicolas div #right : load div nicolas from file textes.html = ok div #right : load div antoine from file textes.html = overwrite content = No! I like to append antoine to nicolas I like to add nicolas then add antone so the #right will be nicolas + antoine I have try to get the content into a var... nope any idea ? on top of that... i will like to add a rule <hr> BETWEEN each load Maybe

How can I detect 'any' ajax request being completed using jQuery?

≡放荡痞女 提交于 2019-11-28 06:01:12
I have a page where I can insert some javascript / jquery to manipulate the output. I don't have any other control over the page markup etc. I need to add an extra element via jquery after each present on the page. The issue is that the elements are generated via an asynchronous call on the existing page which occurs after $(document).ready is complete. Essentially, I need a way of calling my jquery after the page has loaded and the subsequent ajax calls have completed. Is there a way to detect the completion of any ajax call on the page and then call my own custom function to insert the

jQuery: loading css on demand + callback if done

安稳与你 提交于 2019-11-28 05:19:17
I want to load CSS files on demand (by eg. running an XML HTTP request which returns the CSS files to be loaded) for example style1.css , style2.css .. So is there a way in jQuery (or a plugin) to this? bulk-loading several files + adding all those CSS-files into the dom when finished loading: firing a callback (like alerting "all stylesheets are finished loaded!"); the idea is: loading html via xmlhttp , loading +adding required css-files, then - after anything is finished, display that html . any idea? Thanx! How to load multiple CSS files with callback as requested Note: ithout xdomain