Ionic - Taking Pictures with the Camera

preview_player
Показать описание
In this video I will show you how to access the Camera on your device using the Cordova native plugin. You will also learn how you can test your apps on your device by downloading the APK.
Рекомендации по теме
Комментарии
Автор

This still works, had to visit the Febuary 2016 version of the website to download the file, but it worked after following the instructions

For anyone wanting the code without manually copying it all, here you go



$scope.takePicture = function(){

var options = {
quality: 75,
destinationType : Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.CAMERA,
allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
targetWidth:300,
targetHeight: 300,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false
};


$scope.imgURI = "data:image/jpeg;base64, " + imageData;
}, function(err){
console.log(err);
});

}

TheLvPure
Автор

Thanks Alot from me.

I had tired to capture image. But this video ultimately helped me alot. I am new in ionic platform and following is the documentation of ionic to capture image

const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}

=> {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
let base64Image = 'data:image/jpeg;base64, ' + imageData;
}, (err) => {
// Handle error
});

Changing this.camera.DestinationType.FILE_URI, to destinationType: this.camera.DestinationType.DATA_URL,

Help me alot.

Thanks Again

sushilsaxena
Автор

Thanks for this video, it kinda helped me decide on getting Ionic Creator Pro.

LimPehYujiItadori
Автор

I already signed the channel, I activated the notifications .. I loved the video.

Please, continue teaching about plugins ...

Your student from Brazil!!

LaurivaldoLopes
Автор

Great video thanks, i ll implemented on my project. By the way any video up comming on how to connect Auth, sing in log in in Creator project sign in page ? thanks

alessandroaureli
Автор

Hi nice video I have one doubt how can my app create folder for images stores in phone please help me

vinodch
Автор

Please do make toturial for ImagePicker

charlesleybaldemor
Автор

Hi is there any way to use take picture button in one page and get the image from camera to another page in ionic?

suryamadank
Автор

hi, its work in my apk and ipa, but i want to more, can u give me to tutorial, from camera to save in to firebase storage? thnks for your reply

danufisika
Автор

if anyone gets the error providers not found for ionic 4.9++ try importing from ionic-native/camera/ngx for all the camera import statements

chantalshine
Автор

In the page of ngcordova says that it's obsolete, what should i do now?

KaritooRoock
Автор

I tried all not working for me :(, i tried to android still not working

charlesleybaldemor
Автор

Hello I implemented the code as per your great video, however I click on the Take Picture button, using "Ionic Creator" App in IOS to preview, but nothing happens, Camera is not launching. Thanks

jaraya