DroidScript wiki

(was AndroidScript) unofficial documentation by the community

User Tools

Site Tools


built_in:image.save

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

built_in:image.save [2017/02/16 11:14] (current)
stevegarman created
Line 1: Line 1:
 +====== Image.Save ====== 
 +Save a copy of the image to storage. 
 +<​code>​img.Save(file,​ quality)</​code>​ 
 +===== Sample ===== 
 +<code JavaScript imgsave.js>​ 
 +function OnStart() 
 +
 +  lay = app.CreateLayout( "​linear",​ "​VCenter,​FillXY"​ );   
 +  img = app.CreateImage( "/​Sys/​Img/​Droid2.png"​ ); 
 +  img.SetLineWidth( 2 ); 
 +  img.DrawLine( 0,0,1,1 ); 
 +  lay.AddChild( img ); 
 +   
 +  app.AddLayout( lay ); 
 +  // High quality jpeg 
 +  img.Save( "/​sdcard/​test95.jpg",​95 ); 
 +  // Low quality jpeg 
 +  img.Save( "/​sdcard/​test05.jpg",​5 ); 
 +  // png ignores quality 
 +  img.Save( "/​sdcard/​test.png"​ ); 
 +
 +</​code>​
built_in/image.save.txt · Last modified: 2017/02/16 11:14 by stevegarman