Skip to content

Instantly share code, notes, and snippets.

@dmnkhhn
Created July 10, 2010 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmnkhhn/470563 to your computer and use it in GitHub Desktop.
Save dmnkhhn/470563 to your computer and use it in GitHub Desktop.
How to use a screenshot as a background image for a certain view.
var screenshot = win.toImage(); // make sure to change 'win' to whatever your window/view is called
var file = Ti.Filesystem.createTempFile(Ti.Filesystem.resourcesDirectory); // create a temporary file
file.write(screenshot); // write the 'screenshot' to that file.
var w = Ti.UI.createWindow({
backgroundImage:file.nativePath // use the native path of the temp file
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment