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

Android: camera image is stretched when using an overlay

    Details

      Description

      Problem description

      Camera view is stretched and badly displayed when using overlays

      Steps to reproduce

      Code sample taken from bug TIMOB-4745

      app.js

      Ti.UI.setBackgroundColor('#ffffff');
       
      var homeWindow =	Titanium.UI.createWindow
      ({
       
      });
      homeWindow.open();
       
      var displayVoucherOverlayView 	= 	Ti.UI.createView
      ({
      	top:		0,
      	bottom:		0,
      	left:		0,
      	right:		0,
      	opacity:	0.75
      });
      var setAButton	=	Ti.UI.createButton
      ({
      	top:		100,
      	left:		30,
      	right:		30,
      	height:		75,
      	title:		"HELLO"
      });
      displayVoucherOverlayView.add(setAButton);
       
      setAButton.addEventListener('click', function() { alert("I HAVE BEEN PRESSED");} );
       
      var navigationBar = 	Ti.UI.createView
      ({
      	bottom: 			0,
      	height: 			50,
      	right:				0,
      	backgroundColor: 	"#000000",
      	opacity:			0.75
      });
      var navBarTestBtn 	= 	Ti.UI.createView
      ({
      	left:				5,
      	width: 				90,
      	height: 			50,
      	top: 				0,
      	backgroundColor: 	"#000000",
      	borderColor: 		"#FFFFFF",
      	borderWidth: 		2
      });
      var navBarTestBtnText 	= 	Ti.UI.createLabel
      ({
      	width: 				90,
      	text: 				"TEST",
      	color: 				"#FFFFFF",
      	textAlign: 			'center',
      	font: 				{fontSize: 		10}
      });
      navBarTestBtn.add(navBarTestBtnText);
      navigationBar.add(navBarTestBtn);
       
      navBarTestBtn.addEventListener('click',   function() {alert("IM A VIEW WITH A LISTENER");} );
       
      displayVoucherOverlayView.add(navigationBar);
       
      var cameraTransform 	= 	Ti.UI.create2DMatrix();
      cameraTransform 		= 	cameraTransform.scale(2);
       
      Ti.Media.showCamera
      ({
          success:			function(event) {},
          cancel:				function() {},
          error:				function(error) 
      	{
              if (error.code == Ti.Media.NO_CAMERA) 
      		{
      			alert("NO CAMERA");
              } 
      		else 
      		{
      			alert("CAMERA ERROR");
              }
          },
      	mediaTypes:			[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO],
          showControls:		false,
          autohide:			false,
          transform:			cameraTransform,
          overlay:			displayVoucherOverlayView
      });
      

      Camera image appears stretched and blurry. Image taken looks fine.

      Additional info

      IND ticket associated: http://support-admin.appcelerator.com/display/APP-344639

        Attachments

          Activity

            People

            • Assignee:
              joshroesslein Josh Roesslein
              Reporter:
              fcasali Federico Casali
            • Watchers:
              0 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code