Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-19-2004, 06:39 AM
Junior Member
 
Join Date: Aug 2004
Posts: 19
Default can save .png?

save

Description
Saves an image.

Syntax
image.save(name[, compresslevel])

Parameters
name
String. Specifies the full path name of the image to save.
compresslevel
Integer. Optional. For saving png files, it can be from 0 to 9. 0 means no compression, 9 means maximum compression. The default value is 5. For saving jpg files, the default value is 100.

I test save file .png but it not work,why ???

script from test...

var image = Image.load("c:\\test.png'');
image.save("d:\\test2.png'');

Please, help me... :-\
Reply With Quote
  #2 (permalink)  
Old 08-19-2004, 07:06 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:can save .png?

The code should work. Does "c:\\test.jpg" exist?

We tested the code, it works
Code:
var image = Image.load("c:\\test.jpg");
image.save("c:\\test.png");
Reply With Quote
  #3 (permalink)  
Old 08-19-2004, 08:16 AM
Junior Member
 
Join Date: Aug 2004
Posts: 19
Default Re:can save .png?

A... sory.

I want transperent of png.
but I test save mo.png to mo2.png but...

from Scipt...

var image = Image.load("c:\\mo.png");
image.save("c:\\mo2.png");
Shell.open("c:\\mo2.png");


from test...

mo.png is transperrent


mo2.png is no transperrent :'(


and I can't load .png to flash. ???

help me again, please.. :-[
Reply With Quote
  #4 (permalink)  
Old 08-20-2004, 03:13 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:can save .png?

SWFKit Pro doesn't support to write a transparent png file. We will provide the feature in ver2.2.

But it can load a transparent png file into Flash like this
Code:
var png = Image.load("c:\\trans.png", background_color);
png.loadImage(1);
Or you can convert the png to jpg firstly then load it into Flash.
Reply With Quote
  #5 (permalink)  
Old 08-23-2004, 12:41 AM
Junior Member
 
Join Date: Aug 2004
Posts: 19
Default Re:can save .png?

I test script...

var png = Image.load("c:\\mo.png", transparent, 100, 100, 0)
png.loadImage(1);

but it not work(no transparent) ,Why ???





please... :-[
Reply With Quote
  #6 (permalink)  
Old 08-23-2004, 02:36 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:can save .png?

SWF movie can only load JPG files. SWFKit converts the png files to jpgs then load them. So if you want to load a transparent png file, you must change its background color to the background color of the swf movie.

Code:
//Say the SWF background color is 0xFF00
var transparent = 0xFF00;
var png = Image.load("c:\\mo.png", transparent); 
png.loadImage(1);
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:50 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.