Feature
Support high density screenshots for iOS.
Sample Code
Drop the following in an app.js, and fire up the iPhone 4 simulator. It will take a screenshot of the blue window, then log and alert the path to the image. Go to it in Finder and see what size it is. The goal of this ticket is to make it the full resolution (640x960, instead of 320x480).
var win = Ti.UI.createWindow({ backgroundColor: 'blue' });
win.open();
Ti.Media.takeScreenshot(function(event) {
var shotFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'screenshot.png');
if (shotFile.exists()) {
shotFile.deleteFile();
}
shotFile.write(event.media);
Ti.API.info(shotFile.nativePath);
alert(shotFile.nativePath);
});
Pull Request
https://github.com/appcelerator/titanium_mobile/pull/149
I'll send a pull request once my existing one is accepted. https://github.com/appcelerator/titanium_mobile/pull/136 The commit is available here, in the meantime: https://github.com/dawsontoth/titanium_mobile/commit/7a0efacb2ac85616ad417f093ec2aeeb8c3050b4
Fixed my branches; pull request is available here: https://github.com/appcelerator/titanium_mobile/pull/149
Submitted pull request rejected by QE because it did not appear to function properly
I should have been more explicit; did they use the iPhone 4 Retina simulator?
The test must be done with the iPhone (Retina) simulator or an actual iPhone 4 device. I just tested my code again and the 640x960 screenshot is being saved when the proper simulator is used.
Code reviewed. Pull request processed
Tested with 1.8.0.1.v20111114102656 on iPhone Retina Simulator 5.0