Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No camera preview or image #36

Open
skypanther opened this issue Nov 4, 2016 · 1 comment
Open

No camera preview or image #36

skypanther opened this issue Nov 4, 2016 · 1 comment

Comments

@skypanther
Copy link

OK, probably a dumb error on my part. But I don't get a camera preview, just a black view. And pictures I take are all black.

Module version 0.8, SDK 5.5.1.GA, iOS 10.1 on an iPhone 5, NSCamera* keys are included in tiapp (plus the app previously used Ti.Media so camera permissions have been granted)

var camera = SquareCamera.createView({
    top: 0,
    left: 0,
    height: Alloy.Globals.deviceWidth,
    width: Alloy.Globals.deviceWidth,
    detectCodes: false, 
    backgroundColor: "#000",
    backQuality: SquareCamera.QUALITY_HD, // Optional Defaults to QUALITY_HD
    camera: "back", 
    transform: Ti.UI.create2DMatrix().scale(1)
});
camera.addEventListener('success', saveImage);
$.cameraPreviewView.add(camera); // just a <View/>

I see [INFO] [object ComMfoggSquarecameraModule] loaded in the console, but no errors. When I tap my custom shutter / take picture button, I get an all black image.

@skypanther
Copy link
Author

It was not clear to me from the docs that you cannot add the camera view to another view. You have to add it to the window. When I add it to the window, I see the preview. The resulting photos are horribly distorted in aspect ratio and zoom, but that's a different issue.

It would be great if I could add to a view. But, short of that, would you please at least make sure to clearly call out in the docs that you have to add to the window? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant