I create a test app to take a picture, upload to Parse and display on screen. The app work perfect but I have some problems:
- When I take the picture and the camera closes the app shows again but with a graphic error:
I notice that the error it gets fixed when I rotate the screen.
- In my code I put the target Width and Height (600px x 450px), but the image only respect the width. But the Height is proportional to the screen.
I take a picture that should be of 600px x 450px but the result image is 600px x 338px.
This is the image that is stored in Parse:
My code is:
<App Theme="Basic" ClearColor="#eeeeeeff">
<DockPanel>
<StatusBarBackground DockPanel.Dock="Top" />
<JavaScript>
var Parse = require("Parse").Parse;
var Observable = require('FuseJS/Observable');
var Camera = require('FuseJS/Camera');
var Parse = require("Parse").Parse;
Parse.initialize("APP ID", "JAVASCRIPT ID");
var Post = Parse.Object.extend("fotos");
function MyFuction(args) {
Camera.takePicture({ targetWidth:600, targetHeight:450, correctOrientation:true }).then(function(file) {
module.exports.imageFile.value = file;
var newPost = new Post();
var parseFile = new Parse.File(file.name, file);
parseFile.save({success: function(){
newPost.set("foto", parseFile);
newPost.save();
}, error: function(){
//
}
});
});
}
module.exports = {
MyFuction: MyFuction,
imageFile: Observable(null)
};
</JavaScript>
<JavaScript File="parse-1.5.0.min.js" ux:Global="Parse" />
<Panel Background="Red" Width="100%" Height="80." >
<Text Alignment="VerticalCenter" Value="Take Picture and Upload to Parse!" TextColor="#fff" FontSize="20" TextAlignment="Center" />
<Clicked Handler="{MyFuction}" /> </Panel>
<Image File="{imageFile}" Width="100%" Height="100%" StretchMode="Uniform" />
</DockPanel>
</App>
Is it possible that these things do not happen?