Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-4884

toImage() on device with retina display is pixellated (captured at half resolution)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 1.6.0
    • Fix Version/s: Sprint 2012-04, Release 2.0.0
    • Component/s: iOS
    • Environment:
    • Story Points:
      0

      Description

      If you call var a = view.toImage() on a view, and set an ImageView to that blob i.e. imageView.image = a
      on an Iphone with retina display, then the image is displayed at normal resolution and thus is pixelated on an iPhone 4.

      There is a very simple fix to this already out there in the wild, see https://github.com/iamyellow/titanium_mobile/

      I would recommend that change is made to all appropriate UI controls which have a toImage() method.

      app.js

      var win = Titanium.UI.createWindow({
        backgroundColor: '#FFF'
      });
       
      var sourceView = Titanium.UI.createView({
        width: 155,
        left: 5,
        height: 240,
        borderWidth: 1,
        borderColor: '#000'
      });
       
      sourceView.add(Titanium.UI.createLabel({
        text: 'Here is some nice smooth antialised text',
        font: { 
          fontSize: 20
        }
      }));
       
      var targetView = Titanium.UI.createImageView({
        width: 155,
        right: 5,
        height: 240,
        borderWidth: 1,
        borderColor: '#000'
      });
       
      var btn = Titanium.UI.createButton({
        title: 'Copy image to target on right',
        width: 300,
        height: 30,
        bottom: 10
      });
       
      btn.addEventListener('click', function() {
        targetView.image = sourceView.toImage();
      });
       
      win.add(btn);
      win.add(targetView);
      win.add(sourceView);
      win.open();
      

      Please remember this issue is only visible when using an iOS 4 Retina Device.

        Attachments

          Activity

            People

            • Assignee:
              vduggal Vishal Duggal (Inactive)
              Reporter:
              matthew.oriordan Matthew O'Riordan
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-4149
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration