Skip to content

No camera preview or image #36

Open

Description

@skypanther

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.

Activity

  1. skypanther commented on Nov 4, 2016

    @skypanther
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions