6 messages in com.googlegroups.google-desktop-developerRe: How can I load and display images...| Subject: | Re: How can I load and display images from my local drive?![]() |
|---|---|
| From: | FN (noam...@gmail.com) |
| Date: | 02/14/2007 05:46:23 AM |
| List: | com.googlegroups.google-desktop-developer |
Great example. Where can I find more ActiveXObject examples relevant to the gadget?
On Feb 14, 9:28 am, "Lahiru" <llah...@gmail.com> wrote:
Hi FN,
Think this will also help you. :)
You can use this code to load random images from your local drive. Like the "Photo Gadget" in the GD. :)
------------------------------------- function loadFiles() {
var folderName = "C:/img"; //The folder path which your images stored.
var fso = new ActiveXObject("Scripting.FileSystemObject"); var fold = fso.GetFolder(folderName);
var fileCount = fold.files.count; //Number of files you have in that folder.
alert(fileCount);
var fileset = new Enumerator(fold.files);
for (; !fileset.atEnd(); fileset.moveNext()) { var tempp = new String(fileset.item()); //You can get all the file names from here. alert(tempp);
if((tempp.indexOf(".gif")!=-1)||(tempp.indexOf(".jpg")!=-1)) { //And you can filter files using there extensions.
alert("This is a Image File"+tempp); } }
}
-----------------------------------------------------------------------
Cheers! - Lahiru. --http://sistima.blogspot.com/index.html||http://sistimag.blogspot.com/ index.html
On Feb 14, 10:42 am, "FN" <noam...@gmail.com> wrote:
Hi James it so simple that I'm imbarased :-) I was mislead by the API documentation, it looked sound like all the pictures must be packed in the gg file.
Thanks, FN.
On Feb 13, 11:33 pm, "James [GD Team]" <j....@google.com> wrote:
Hello,
You can set the "src" attribute in the "img" element to a local path.
So if in main.xml:
<img height="32" name="my_image" width="32" x="31" y="28" src="c:\\temp\kitten.jpg"/>
Or from script:
my_image.src = 'c:\\temp\puppy.jpg';
Cheers! James
On Feb 13, 6:13 am, "FN" <noam...@gmail.com> wrote:
Hi, I'm new to Google designer. I want to make a simple application that reads images from the local drive (for example c:\Temp) and display it randomly in the gadget. I don't want to add the images to the gg package that will be created. The question is "How can I load and display images from my local drive?" BR, FN.- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -




