Copy link to clipboard
Copied
Wen I open the camera dialog and then either hit cancel or take a pic and return to my app.... my entire stage zooms. It looks like its zooming to show any off stage content. If I then rotate the app 180 degrees it readjusts to be normal again. My app is a landscape app.
If I set the app to be EXACT_FIT the problem happens and then auto corrects itself. Still looks really bad for the second that it happens though.
The camera portion is crucial to my app .. so hoping there is a known fix for this.
Any help appreciated as always!
Copy link to clipboard
Copied
Could it be that the camera app is portrait, and your app is getting a resize event? What happens if you disable resize listening before opening the camera, and turn the listener back on, if you need to, when the camera goes away.
Copy link to clipboard
Copied
I'll give that a try right now
Copy link to clipboard
Copied
Wait ... which resize event am I supposed ti disable ?
Copy link to clipboard
Copied
What stage scalemode are you using? If it's noScale you presumably listen for a resize event in order to know the size of the stage. That one.
Copy link to clipboard
Copied
I'm actually hoping to use
stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.quality = StageQuality.BEST;
I dont have any manual listeners set up to listen to resize events though.
Copy link to clipboard
Copied
Another interesting point.. when I use the EXACT_FIT method and it glitches and then resets to the right position.. the quality looks like it changes from BEST to LOW .. however if I rotate the phone 180 degrees.. the quality resets back to BEST. I can visually see the quality difference. It's highly noticeable.
Copy link to clipboard
Copied
I cant believe that in all these years of AIR being supported on iOS that you cant take a photo in landscape mode. This boggles my mind.
Copy link to clipboard
Copied
I haven't tried to use the camera yet, but in all my AIR apps (landscape games), I use this code:
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
Not sure if it'll help but wanted to throw it out there.
Copy link to clipboard
Copied
Ya I tried that.. it doesnt help the issue. There are major problems with using the camera in landscape mode.. doesnt look like it's doable.
Copy link to clipboard
Copied
Are you using an ANE to activate the camera? What AIR SDK? Maybe you should open a bug at http://bugbase.adobe.com
Copy link to clipboard
Copied
No I'm just using the basic camera offerings.
Copy link to clipboard
Copied
Do you know of any ANE's for handling the camera? Maybe that would solve the problem?
Copy link to clipboard
Copied
There's a bunch here: Native extensions for Adobe AIR | Adobe Developer Connection
Copy link to clipboard
Copied
Hmm .. so far only 1 for $40 .. pricey without knowing if it will solve my problem
I'm hoping Colin can save the day as he has many times over the years
Grrr.. I'm really surprised though that I cant find anyone with this issue via Google searches.
The stage going all messed up is one issue... the fact that even when you do get a "sort of" fix working .. the stage quality changes to be really low .. until you rotate the device 180 degrees.
Copy link to clipboard
Copied
You could always write your own, I've written a couple now. You do need a mac and xcode tho.
Copy link to clipboard
Copied
did you look through the bugbase to see if anyone's filed a bug report on this? Are you using an up-to-date AIR SDK?
Copy link to clipboard
Copied
I'm going to send you $40.
Not really, I made that up. Can you say something about the reason you are using the camera? One solution I've used is to do a normal Flash Camera class, that works well in landscape, and you get the bonus of being able to overlay UI elements.
I have done landscape apps that use the native camera, without problems. I'm not sure why I got away with it.
Copy link to clipboard
Copied
I just need to use the camera on iOS and Android to take a picture and have that picture as bitmap data on the stage. Pretty simple. App is in landscape mode.
Hmmm .. I've never used the Flash Camera class
I'm using this
function initCamera(evt:Event):void{
endTouchX = mouseX;
endTouchY = mouseY;
if (startTouchX - endTouchX < 25 && startTouchX - endTouchX >-25 && startTouchY - endTouchY < 25 && startTouchY - endTouchY >-25) {
takePhotoBTN.alpha = 1;
trace("Starting Camera");
if( CameraUI.isSupported )
{
cameraUI.addEventListener(MediaEvent.COMPLETE, imageSelected);
cameraUI.addEventListener(Event.CANCEL, browseCancelled);
cameraUI.addEventListener(ErrorEvent.ERROR, mediaError);
cameraUI.launch(MediaType.IMAGE);
}
else
{
trace("This device does not support Camera functions.");
}
}
}
Copy link to clipboard
Copied
I'm sure you can use the regular Camera class then. Look at the example code here, and also the draw method:
Copy link to clipboard
Copied
Tried the sample code.. this gives me a live video preview on the stage. The quality is pretty bad though. Is there a way to give better quality? Also not sure how to take a picture. Hoping its not to just draw bitmap of whats on the live feed as I assume that would give blurry results.
Thoughts?
Copy link to clipboard
Copied
So for anyone else that runs in to this..
Beta 18 somewhat fixes the issue. It still happens.. only it corrects itself.
My solution..
I created an animation of a black box that is the size of the entire stage... it animates in.. on animation complete it fires the camera. This way you cant see the stage get all jumbled up. Once you return to the stage.. I set a .3 second delay on the animation removing. This creates a seamless transition.