Mozilla
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists Mozilla

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old October 21st, 2006, 09:30 PM
Dan
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
internalSave with AutoChosen?

Hi,

I'm working on a firefox 2.0+ extension that creates and then saves the
contents of a canvas. It works fine, but I can't seem to get it save
the image (via the internalSave function in contentAreaUtils.js)
without popping up the save file picker dialog. Shouldn't setting the
AutoChosen file prevent the dialog from appearing? I've spent all day
trying to get this to work, so any suggestions would be really
appreciated. Here's the relevant code:

var localfile = Components.classes["@mozilla.org/file/local;1"].
createInstance()

localfile.initWithPath("c:\\image.jpg");

var localuri = makeFileURI(localfile);

internalSave(canvas.toDataURL('image/jpeg','quality=100'), null,
'image.jpg', null, 'image/jpeg', true, null, AutoChosen(localfile,
localuri), null);

Thanks,
Dan


dev-tech-xul mailing list
dev-tech-xul (AT) lists (DOT) mozilla.org

Reply With Quote
  #2  
Old January 3rd, 2008, 08:08 PM
alvayang alvayang is offline
Registered User
Dev Archives Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Posts: 1 alvayang User rank is Just a Lowly Private (1 - 20 Reputation Level)  
Time spent in forums: 1 m 51 sec
Reputation Power: 0
Quote:
Originally Posted by Dan
Hi,

I'm working on a firefox 2.0+ extension that creates and then saves the
contents of a canvas. It works fine, but I can't seem to get it save
the image (via the internalSave function in contentAreaUtils.js)
without popping up the save file picker dialog. Shouldn't setting the
AutoChosen file prevent the dialog from appearing? I've spent all day
trying to get this to work, so any suggestions would be really
appreciated. Here's the relevant code:

var localfile = Components.classes["@mozilla.org/file/local;1"].
createInstance()

localfile.initWithPath("c:\\image.jpg");

var localuri = makeFileURI(localfile);

internalSave(canvas.toDataURL('image/jpeg','quality=100'), null,
'image.jpg', null, 'image/jpeg', true, null, AutoChosen(localfile,
localuri), null);

Thanks,
Dan


dev-tech-xul mailing list
dev-tech-xul (AT) lists (DOT) mozilla.org


Hi,Dan
I'm also in this trouble, in my codes the AutoChosen function retruns "undefined", So, it's unuseable , but how to make it non-null?
sorry for my poor english

alva

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists Mozilla > internalSave with AutoChosen?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT