Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4466] iOS: High Density Screenshots

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-07-15T16:38:47.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sSprint 2011-28, Release 1.8.0
ComponentsiOS
Labelsmodule_filesystem, qe-testadded
ReporterDawson Toth
AssigneeReggie Seagraves
Created2011-06-21T06:32:47.000+0000
Updated2011-11-15T15:57:40.000+0000

Description

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

Comments

  1. Dawson Toth 2011-06-21

    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
  2. Dawson Toth 2011-06-23

    Fixed my branches; pull request is available here: https://github.com/appcelerator/titanium_mobile/pull/149
  3. Reggie Seagraves 2011-06-23

    Submitted pull request rejected by QE because it did not appear to function properly
  4. Dawson Toth 2011-06-23

    I should have been more explicit; did they use the iPhone 4 Retina simulator?
  5. Dawson Toth 2011-07-05

    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.
  6. Reggie Seagraves 2011-07-15

    Code reviewed. Pull request processed
  7. Natalie Huynh 2011-11-15

    Tested with 1.8.0.1.v20111114102656 on iPhone Retina Simulator 5.0

JSON Source