diff --git a/doc/de/README.md b/doc/de/README.md deleted file mode 100644 index 97e6526a8..000000000 --- a/doc/de/README.md +++ /dev/null @@ -1,421 +0,0 @@ - - -# cordova-plugin-camera - -[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera) - -Dieses Plugin definiert eine globale `navigator.camera`-Objekt, das eine API für Aufnahmen und für die Auswahl der Bilder aus dem System-Image-Library bietet. - -Obwohl das Objekt mit der globalen Gültigkeitsbereich `navigator` verbunden ist, steht es nicht bis nach dem `Deviceready`-Ereignis. - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log(navigator.camera); - } - - -## Installation - - cordova plugin add cordova-plugin-camera - - -## API - - * Kamera - * navigator.camera.getPicture(success, fail, options) - * CameraOptions - * CameraPopoverHandle - * CameraPopoverOptions - * navigator.camera.cleanup - -## navigator.camera.getPicture - -Nimmt ein Foto mit der Kamera, oder ein Foto aus dem Gerät Bildergalerie abgerufen. Das Bild wird an den Erfolg-Rückruf als base64-codierte `String` oder als URI für die Image-Datei übergeben. Die Methode selbst gibt ein `CameraPopoverHandle`-Objekt, das verwendet werden kann, um die Datei-Auswahl-Popover neu zu positionieren. - - navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions); - - -#### Beschreibung - -Die `camera.getPicture`-Funktion öffnet das Gerät Standard-Kamera-Anwendung, die Benutzern ermöglicht, Bilder ausrichten. Dieses Verhalten tritt in der Standardeinstellung, wenn `Camera.sourceType` `Camera.PictureSourceType.CAMERA` entspricht. Sobald der Benutzer die Fotoschnäpper, die Kameraanwendung geschlossen wird und die Anwendung wird wiederhergestellt. - -Wenn `Camera.sourceType` `Camera.PictureSourceType.PHOTOLIBRARY` oder `Camera.PictureSourceType.SAVEDPHOTOALBUM` ist, dann wird ein Dialogfeld angezeigt, das Benutzern ermöglicht, ein vorhandenes Bild auszuwählen. Die `camera.getPicture`-Funktion gibt ein `CameraPopoverHandle`-Objekt, das verwendet werden kann, um die Bild-Auswahl-Dialog, z. B. beim ändert sich der Orientierung des Geräts neu positionieren. - -Der Rückgabewert wird an die `cameraSuccess`-Callback-Funktion in einem der folgenden Formate, je nach dem angegebenen `cameraOptions` gesendet: - - * A `String` mit dem base64-codierte Foto-Bild. - - * A `String` , die die Bild-Datei-Stelle auf lokalem Speicher (Standard). - -Sie können tun, was Sie wollen, mit dem codierten Bildes oder URI, zum Beispiel: - - * Rendern Sie das Bild in ein `` Tag, wie im folgenden Beispiel - - * Die Daten lokal zu speichern ( `LocalStorage` , [Lawnchair](http://brianleroux.github.com/lawnchair/), etc..) - - * Post die Daten an einen entfernten server - -**Hinweis**: Fotoauflösung auf neueren Geräten ist ganz gut. Fotos aus dem Gerät Galerie ausgewählt sind nicht zu einer niedrigeren Qualität herunterskaliert, selbst wenn ein `Qualität`-Parameter angegeben wird. Um Speicherprobleme zu vermeiden, legen Sie `Camera.destinationType` auf `FILE_URI` statt `DATA_URL`. - -#### Unterstützte Plattformen - -![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png) - -#### Beispiel - -Nehmen Sie ein Foto und rufen Sie sie als base64-codierte Bild: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -Nehmen Sie ein Foto und rufen Sie das Bild-Datei-Speicherort: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -#### "Einstellungen" (iOS) - - * **CameraUsesGeolocation** (Boolean, Standardwert ist False). Zur Erfassung von JPEGs, auf true festgelegt, um Geolocation-Daten im EXIF-Header zu erhalten. Dies löst einen Antrag auf Geolocation-Berechtigungen, wenn auf True festgelegt. - - - - -#### Amazon Fire OS Macken - -Amazon Fire OS verwendet Absichten zum Starten von der Kamera-Aktivität auf dem Gerät, um Bilder zu erfassen und auf Handys mit wenig Speicher, Cordova Tätigkeit getötet werden kann. In diesem Szenario kann das Bild nicht angezeigt, wenn die Aktivität von Cordova wiederhergestellt wird. - -#### Android Eigenarten - -Android verwendet Absichten zum Starten von der Kamera-Aktivität auf dem Gerät, um Bilder zu erfassen und auf Handys mit wenig Speicher, Cordova Tätigkeit getötet werden kann. In diesem Szenario kann das Bild nicht angezeigt, wenn die Aktivität von Cordova wiederhergestellt wird. - -#### Browser-Eigenheiten - -Fotos können nur als base64-codierte Bild zurückgeben werden. - -#### Firefox OS Macken - -Kamera-Plugin ist derzeit implementiert mithilfe von [Web-Aktivitäten](https://hacks.mozilla.org/2013/01/introducing-web-activities/). - -#### iOS Macken - -Einschließlich einer JavaScript-`alert()` entweder Rückruffunktionen kann Probleme verursachen. Wickeln Sie die Warnung innerhalb eine `setTimeout()` erlauben die iOS-Bild-Picker oder Popover vollständig zu schließen, bevor die Warnung angezeigt: - - setTimeout(function() { - // do your thing here! - }, 0); - - -#### Windows Phone 7 Macken - -Die native Kameraanwendung aufrufen, während das Gerät via Zune angeschlossen ist funktioniert nicht und löst eine Fehler-Callback. - -#### Tizen Macken - -Tizen unterstützt nur ein `DestinationType` von `Camera.DestinationType.FILE_URI` und ein `SourceType` von `Camera.PictureSourceType.PHOTOLIBRARY`. - -## CameraOptions - -Optionale Parameter die Kameraeinstellungen anpassen. - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - - * **Qualität**: Qualität des gespeicherten Bildes, ausgedrückt als ein Bereich von 0-100, wo 100 in der Regel voller Auflösung ohne Verlust aus der Dateikomprimierung ist. Der Standardwert ist 50. *(Anzahl)* (Beachten Sie, dass Informationen über die Kamera Auflösung nicht verfügbar ist.) - - * **DestinationType**: Wählen Sie das Format des Rückgabewerts. Der Standardwert ist FILE_URI. Im Sinne `navigator.camera.DestinationType` *(Anzahl)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - - * **SourceType**: Legen Sie die Quelle des Bildes. Der Standardwert ist die Kamera. Im Sinne `navigator.camera.PictureSourceType` *(Anzahl)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - - * **AllowEdit**: einfache Bearbeitung des Bildes vor Auswahl zu ermöglichen. *(Boolesch)* - - * **EncodingType**: die zurückgegebene Image-Datei ist Codierung auswählen. Standardwert ist JPEG. Im Sinne `navigator.camera.EncodingType` *(Anzahl)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - - * **TargetWidth**: Breite in Pixel zum Bild skalieren. Muss mit **TargetHeight**verwendet werden. Seitenverhältnis bleibt konstant. *(Anzahl)* - - * **TargetHeight**: Höhe in Pixel zum Bild skalieren. Muss mit **TargetWidth**verwendet werden. Seitenverhältnis bleibt konstant. *(Anzahl)* - - * **MediaType**: Legen Sie den Typ der Medien zur Auswahl. Funktioniert nur, wenn `PictureSourceType` ist `PHOTOLIBRARY` oder `SAVEDPHOTOALBUM` . Im Sinne `nagivator.camera.MediaType` *(Anzahl)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. STANDARD. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - - * **CorrectOrientation**: Drehen Sie das Bild um die Ausrichtung des Geräts während der Aufnahme zu korrigieren. *(Boolesch)* - - * **SaveToPhotoAlbum**: das Bild auf das Fotoalbum auf dem Gerät zu speichern, nach Einnahme. *(Boolesch)* - - * **PopoverOptions**: iOS-nur Optionen, die Popover Lage in iPad angeben. In definierten`CameraPopoverOptions`. - - * **CameraDirection**: Wählen Sie die Kamera (vorn oder hinten-gerichtete) verwenden. Der Standardwert ist zurück. Im Sinne `navigator.camera.Direction` *(Anzahl)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -#### Amazon Fire OS Macken - - * `cameraDirection`Ergebnisse in einem hinten gerichteter Foto Wert. - - * Ignoriert die `allowEdit` Parameter. - - * `Camera.PictureSourceType.PHOTOLIBRARY`und `Camera.PictureSourceType.SAVEDPHOTOALBUM` beide das gleiche Fotoalbum anzuzeigen. - -#### Android Eigenarten - - * `cameraDirection`Ergebnisse in einem hinten gerichteter Foto Wert. - - * Android verwendet auch die Ernte-Aktivität für AllowEdit, obwohl Ernte sollte arbeiten und das zugeschnittene Bild zurück zu Cordova, das einzige, dass Werke konsequent die gebündelt mit der Google-Plus-Fotos-Anwendung ist tatsächlich zu übergeben. Andere Kulturen funktioniert möglicherweise nicht. - - * `Camera.PictureSourceType.PHOTOLIBRARY`und `Camera.PictureSourceType.SAVEDPHOTOALBUM` beide das gleiche Fotoalbum anzuzeigen. - -#### BlackBerry 10 Macken - - * Ignoriert die `quality` Parameter. - - * Ignoriert die `allowEdit` Parameter. - - * `Camera.MediaType`wird nicht unterstützt. - - * Ignoriert die `correctOrientation` Parameter. - - * Ignoriert die `cameraDirection` Parameter. - -#### Firefox OS Macken - - * Ignoriert die `quality` Parameter. - - * `Camera.DestinationType`wird ignoriert, und gleich `1` (Bilddatei-URI) - - * Ignoriert die `allowEdit` Parameter. - - * Ignoriert die `PictureSourceType` Parameter (Benutzer wählt es in einem Dialogfenster) - - * Ignoriert die`encodingType` - - * Ignoriert die `targetWidth` und`targetHeight` - - * `Camera.MediaType`wird nicht unterstützt. - - * Ignoriert die `correctOrientation` Parameter. - - * Ignoriert die `cameraDirection` Parameter. - -#### iOS Macken - - * Legen Sie `quality` unter 50 Speicherfehler auf einigen Geräten zu vermeiden. - - * Bei der Verwendung `destinationType.FILE_URI` , Fotos werden im temporären Verzeichnis der Anwendung gespeichert. Den Inhalt des temporären Verzeichnis der Anwendung wird gelöscht, wenn die Anwendung beendet. - -#### Tizen Macken - - * nicht unterstützte Optionen - - * gibt immer einen Datei-URI - -#### Windows Phone 7 und 8 Eigenarten - - * Ignoriert die `allowEdit` Parameter. - - * Ignoriert die `correctOrientation` Parameter. - - * Ignoriert die `cameraDirection` Parameter. - - * Ignoriert die `saveToPhotoAlbum` Parameter. WICHTIG: Alle Aufnahmen die wp7/8 Cordova-Kamera-API werden immer in Kamerarolle des Telefons kopiert. Abhängig von den Einstellungen des Benutzers könnte dies auch bedeuten, dass das Bild in ihre OneDrive automatisch hochgeladen ist. Dies könnte möglicherweise bedeuten, dass das Bild für ein breiteres Publikum als Ihre Anwendung vorgesehen ist. Wenn diese einen Blocker für Ihre Anwendung, Sie müssen die CameraCaptureTask zu implementieren, wie im Msdn dokumentiert: Sie können kommentieren oder Up-Abstimmung das Beiträge zu diesem Thema im [Bugtracker](https://issues.apache.org/jira/browse/CB-2083) - - * Ignoriert die `mediaType` -Eigenschaft des `cameraOptions` wie das Windows Phone SDK keine Möglichkeit, Fotothek Videos wählen. - -## CameraError - -onError-Callback-Funktion, die eine Fehlermeldung bereitstellt. - - function(message) { - // Show a helpful message - } - - -#### Beschreibung - - * **Meldung**: die Nachricht wird durch das Gerät systemeigenen Code bereitgestellt. *(String)* - -## cameraSuccess - -onSuccess Callback-Funktion, die die Bilddaten bereitstellt. - - function(imageData) { - // Do something with the image - } - - -#### Beschreibung - - * **CMYK**: Base64-Codierung der Bilddaten, *oder* die Image-Datei-URI, je nach `cameraOptions` in Kraft. *(String)* - -#### Beispiel - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -Ein Handle für das Dialogfeld "Popover" erstellt von `navigator.camera.getPicture`. - -#### Beschreibung - - * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position. - -#### Unterstützte Plattformen - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### Beispiel - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -nur iOS-Parametern, die Anker-Element Lage und Pfeil Richtung der Popover angeben, bei der Auswahl von Bildern aus einem iPad Bibliothek oder Album. - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -#### Beschreibung - - * **X**: x Pixelkoordinate des Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)* - - * **y**: y Pixelkoordinate des Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)* - - * **width**: Breite in Pixeln, das Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)* - - * **height**: Höhe in Pixeln, das Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)* - - * **arrowDir**: Richtung der Pfeil auf der Popover zeigen sollte. Im Sinne `Camera.PopoverArrowDirection` *(Anzahl)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -Beachten Sie, dass die Größe der Popover ändern kann, um die Richtung des Pfeils und Ausrichtung des Bildschirms anzupassen. Achten Sie darauf, um Orientierung zu berücksichtigen, wenn Sie den Anker-Element-Speicherort angeben. - -## navigator.camera.cleanup - -Entfernt Mittelstufe Fotos von der Kamera aus der vorübergehenden Verwahrung genommen. - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -#### Beschreibung - -Fortgeschrittene Image-Dateien, die in vorübergehender Verwahrung gehalten werden, nach dem Aufruf von `camera.getPicture` entfernt. Gilt nur wenn der Wert von `Camera.sourceType` gleich `Camera.PictureSourceType.CAMERA` und `Camera.destinationType` gleich `Camera.DestinationType.FILE_URI`. - -#### Unterstützte Plattformen - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### Beispiel - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } \ No newline at end of file diff --git a/doc/de/index.md b/doc/de/index.md deleted file mode 100644 index 1c7486cec..000000000 --- a/doc/de/index.md +++ /dev/null @@ -1,434 +0,0 @@ - - -# cordova-plugin-camera - -Dieses Plugin definiert eine globale `navigator.camera`-Objekt, das eine API für Aufnahmen und für die Auswahl der Bilder aus dem System-Image-Library bietet. - -Obwohl das Objekt mit der globalen Gültigkeitsbereich `navigator` verbunden ist, steht es nicht bis nach dem `Deviceready`-Ereignis. - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log(navigator.camera); - } - - -## Installation - - cordova plugin add cordova-plugin-camera - - -## navigator.camera.getPicture - -Nimmt ein Foto mit der Kamera, oder ein Foto aus dem Gerät Bildergalerie abgerufen. Das Bild wird an den Erfolg-Rückruf als base64-codierte `String` oder als URI für die Image-Datei übergeben. Die Methode selbst gibt ein `CameraPopoverHandle`-Objekt, das verwendet werden kann, um die Datei-Auswahl-Popover neu zu positionieren. - - navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions ); - - -### Beschreibung - -Die `camera.getPicture`-Funktion öffnet das Gerät Standard-Kamera-Anwendung, die Benutzern ermöglicht, Bilder ausrichten. Dieses Verhalten tritt in der Standardeinstellung, wenn `Camera.sourceType` `Camera.PictureSourceType.CAMERA` entspricht. Sobald der Benutzer die Fotoschnäpper, die Kameraanwendung geschlossen wird und die Anwendung wird wiederhergestellt. - -Wenn `Camera.sourceType` `Camera.PictureSourceType.PHOTOLIBRARY` oder `Camera.PictureSourceType.SAVEDPHOTOALBUM` ist, dann wird ein Dialogfeld angezeigt, das Benutzern ermöglicht, ein vorhandenes Bild auszuwählen. Die `camera.getPicture`-Funktion gibt ein `CameraPopoverHandle`-Objekt, das verwendet werden kann, um die Bild-Auswahl-Dialog, z. B. beim ändert sich der Orientierung des Geräts neu positionieren. - -Der Rückgabewert wird an die `cameraSuccess`-Callback-Funktion in einem der folgenden Formate, je nach dem angegebenen `cameraOptions` gesendet: - -* A `String` mit dem base64-codierte Foto-Bild. - -* A `String` , die die Bild-Datei-Stelle auf lokalem Speicher (Standard). - -Sie können tun, was Sie wollen, mit dem codierten Bildes oder URI, zum Beispiel: - -* Rendern Sie das Bild in ein `` Tag, wie im folgenden Beispiel - -* Die Daten lokal zu speichern ( `LocalStorage` , [Lawnchair][1], etc..) - -* Post die Daten an einen entfernten server - - [1]: http://brianleroux.github.com/lawnchair/ - -**Hinweis**: Fotoauflösung auf neueren Geräten ist ganz gut. Fotos aus dem Gerät Galerie ausgewählt sind nicht zu einer niedrigeren Qualität herunterskaliert, selbst wenn ein `Qualität`-Parameter angegeben wird. Um Speicherprobleme zu vermeiden, legen Sie `Camera.destinationType` auf `FILE_URI` statt `DATA_URL`. - -### Unterstützte Plattformen - -* Amazon Fire OS -* Android -* BlackBerry 10 -* Browser -* Firefox OS -* iOS -* Tizen -* Windows Phone 7 und 8 -* Windows 8 - -### "Einstellungen" (iOS) - -* **CameraUsesGeolocation** (Boolean, Standardwert ist False). Zur Erfassung von JPEGs, auf true festgelegt, um Geolocation-Daten im EXIF-Header zu erhalten. Dies löst einen Antrag auf Geolocation-Berechtigungen, wenn auf True festgelegt. - - - - -### Amazon Fire OS Macken - -Amazon Fire OS verwendet Absichten zum Starten von der Kamera-Aktivität auf dem Gerät, um Bilder zu erfassen und auf Handys mit wenig Speicher, Cordova Tätigkeit getötet werden kann. In diesem Szenario kann das Bild nicht angezeigt, wenn die Aktivität von Cordova wiederhergestellt wird. - -### Android Eigenarten - -Android verwendet Absichten zum Starten von der Kamera-Aktivität auf dem Gerät, um Bilder zu erfassen und auf Handys mit wenig Speicher, Cordova Tätigkeit getötet werden kann. In diesem Szenario kann das Bild nicht angezeigt, wenn die Aktivität von Cordova wiederhergestellt wird. - -### Browser-Eigenheiten - -Fotos können nur als base64-codierte Bild zurückgeben werden. - -### Firefox OS Macken - -Kamera-Plugin ist derzeit implementiert mithilfe von [Web-Aktivitäten][2]. - - [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ - -### iOS Macken - -Einschließlich einer JavaScript-`alert()` entweder Rückruffunktionen kann Probleme verursachen. Wickeln Sie die Warnung innerhalb eine `setTimeout()` erlauben die iOS-Bild-Picker oder Popover vollständig zu schließen, bevor die Warnung angezeigt: - - setTimeout(function() { - // do your thing here! - }, 0); - - -### Windows Phone 7 Macken - -Die native Kameraanwendung aufrufen, während das Gerät via Zune angeschlossen ist funktioniert nicht und löst eine Fehler-Callback. - -### Tizen Macken - -Tizen unterstützt nur ein `DestinationType` von `Camera.DestinationType.FILE_URI` und ein `SourceType` von `Camera.PictureSourceType.PHOTOLIBRARY`. - -### Beispiel - -Nehmen Sie ein Foto und rufen Sie sie als base64-codierte Bild: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -Nehmen Sie ein Foto und rufen Sie das Bild-Datei-Speicherort: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -## CameraOptions - -Optionale Parameter die Kameraeinstellungen anpassen. - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - -### Optionen - -* **Qualität**: Qualität des gespeicherten Bildes, ausgedrückt als ein Bereich von 0-100, wo 100 in der Regel voller Auflösung ohne Verlust aus der Dateikomprimierung ist. Der Standardwert ist 50. *(Anzahl)* (Beachten Sie, dass Informationen über die Kamera Auflösung nicht verfügbar ist.) - -* **DestinationType**: Wählen Sie das Format des Rückgabewerts. Der Standardwert ist FILE_URI. Im Sinne `navigator.camera.DestinationType` *(Anzahl)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - -* **SourceType**: Legen Sie die Quelle des Bildes. Der Standardwert ist die Kamera. Im Sinne `navigator.camera.PictureSourceType` *(Anzahl)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - -* **AllowEdit**: einfache Bearbeitung des Bildes vor Auswahl zu ermöglichen. *(Boolesch)* - -* **EncodingType**: die zurückgegebene Image-Datei ist Codierung auswählen. Standardwert ist JPEG. Im Sinne `navigator.camera.EncodingType` *(Anzahl)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - -* **TargetWidth**: Breite in Pixel zum Bild skalieren. Muss mit **TargetHeight**verwendet werden. Seitenverhältnis bleibt konstant. *(Anzahl)* - -* **TargetHeight**: Höhe in Pixel zum Bild skalieren. Muss mit **TargetWidth**verwendet werden. Seitenverhältnis bleibt konstant. *(Anzahl)* - -* **MediaType**: Legen Sie den Typ der Medien zur Auswahl. Funktioniert nur, wenn `PictureSourceType` ist `PHOTOLIBRARY` oder `SAVEDPHOTOALBUM` . Im Sinne `nagivator.camera.MediaType` *(Anzahl)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. STANDARD. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - -* **CorrectOrientation**: Drehen Sie das Bild um die Ausrichtung des Geräts während der Aufnahme zu korrigieren. *(Boolesch)* - -* **SaveToPhotoAlbum**: das Bild auf das Fotoalbum auf dem Gerät zu speichern, nach Einnahme. *(Boolesch)* - -* **PopoverOptions**: iOS-nur Optionen, die Popover Lage in iPad angeben. In definierten`CameraPopoverOptions`. - -* **CameraDirection**: Wählen Sie die Kamera (vorn oder hinten-gerichtete) verwenden. Der Standardwert ist zurück. Im Sinne `navigator.camera.Direction` *(Anzahl)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -### Amazon Fire OS Macken - -* `cameraDirection`Ergebnisse in einem hinten gerichteter Foto Wert. - -* Ignoriert die `allowEdit` Parameter. - -* `Camera.PictureSourceType.PHOTOLIBRARY`und `Camera.PictureSourceType.SAVEDPHOTOALBUM` beide das gleiche Fotoalbum anzuzeigen. - -### Android Eigenarten - -* `cameraDirection`Ergebnisse in einem hinten gerichteter Foto Wert. - -* Ignoriert die `allowEdit` Parameter. - -* `Camera.PictureSourceType.PHOTOLIBRARY`und `Camera.PictureSourceType.SAVEDPHOTOALBUM` beide das gleiche Fotoalbum anzuzeigen. - -### BlackBerry 10 Macken - -* Ignoriert die `quality` Parameter. - -* Ignoriert die `allowEdit` Parameter. - -* `Camera.MediaType`wird nicht unterstützt. - -* Ignoriert die `correctOrientation` Parameter. - -* Ignoriert die `cameraDirection` Parameter. - -### Firefox OS Macken - -* Ignoriert die `quality` Parameter. - -* `Camera.DestinationType`wird ignoriert, und gleich `1` (Bilddatei-URI) - -* Ignoriert die `allowEdit` Parameter. - -* Ignoriert die `PictureSourceType` Parameter (Benutzer wählt es in einem Dialogfenster) - -* Ignoriert die`encodingType` - -* Ignoriert die `targetWidth` und`targetHeight` - -* `Camera.MediaType`wird nicht unterstützt. - -* Ignoriert die `correctOrientation` Parameter. - -* Ignoriert die `cameraDirection` Parameter. - -### iOS Macken - -* Legen Sie `quality` unter 50 Speicherfehler auf einigen Geräten zu vermeiden. - -* Bei der Verwendung `destinationType.FILE_URI` , Fotos werden im temporären Verzeichnis der Anwendung gespeichert. Den Inhalt des temporären Verzeichnis der Anwendung wird gelöscht, wenn die Anwendung beendet. - -### Tizen Macken - -* nicht unterstützte Optionen - -* gibt immer einen Datei-URI - -### Windows Phone 7 und 8 Eigenarten - -* Ignoriert die `allowEdit` Parameter. - -* Ignoriert die `correctOrientation` Parameter. - -* Ignoriert die `cameraDirection` Parameter. - -* Ignoriert die `saveToPhotoAlbum` Parameter. WICHTIG: Alle Aufnahmen die wp7/8 Cordova-Kamera-API werden immer in Kamerarolle des Telefons kopiert. Abhängig von den Einstellungen des Benutzers könnte dies auch bedeuten, dass das Bild in ihre OneDrive automatisch hochgeladen ist. Dies könnte möglicherweise bedeuten, dass das Bild für ein breiteres Publikum als Ihre Anwendung vorgesehen ist. Wenn diese einen Blocker für Ihre Anwendung, Sie müssen die CameraCaptureTask zu implementieren, wie im Msdn dokumentiert: Sie können kommentieren oder Up-Abstimmung das Beiträge zu diesem Thema im [Bugtracker][3] - -* Ignoriert die `mediaType` -Eigenschaft des `cameraOptions` wie das Windows Phone SDK keine Möglichkeit, Fotothek Videos wählen. - - [3]: https://issues.apache.org/jira/browse/CB-2083 - -## CameraError - -onError-Callback-Funktion, die eine Fehlermeldung bereitstellt. - - function(message) { - // Show a helpful message - } - - -### Parameter - -* **Meldung**: die Nachricht wird durch das Gerät systemeigenen Code bereitgestellt. *(String)* - -## cameraSuccess - -onSuccess Callback-Funktion, die die Bilddaten bereitstellt. - - function(imageData) { - // Do something with the image - } - - -### Parameter - -* **CMYK**: Base64-Codierung der Bilddaten, *oder* die Image-Datei-URI, je nach `cameraOptions` in Kraft. *(String)* - -### Beispiel - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -Ein Handle für das Dialogfeld "Popover" erstellt von `navigator.camera.getPicture`. - -### Methoden - -* **SetPosition**: Legen Sie die Position der Popover. - -### Unterstützte Plattformen - -* iOS - -### setPosition - -Legen Sie die Position von der Popover. - -**Parameter**: - -* `cameraPopoverOptions`: die `CameraPopoverOptions` angeben, dass die neue Position - -### Beispiel - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -nur iOS-Parametern, die Anker-Element Lage und Pfeil Richtung der Popover angeben, bei der Auswahl von Bildern aus einem iPad Bibliothek oder Album. - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -### CameraPopoverOptions - -* **X**: x Pixelkoordinate des Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)* - -* **y**: y Pixelkoordinate des Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)* - -* **width**: Breite in Pixeln, das Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)* - -* **height**: Höhe in Pixeln, das Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)* - -* **arrowDir**: Richtung der Pfeil auf der Popover zeigen sollte. Im Sinne `Camera.PopoverArrowDirection` *(Anzahl)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -Beachten Sie, dass die Größe der Popover ändern kann, um die Richtung des Pfeils und Ausrichtung des Bildschirms anzupassen. Achten Sie darauf, um Orientierung zu berücksichtigen, wenn Sie den Anker-Element-Speicherort angeben. - -## navigator.camera.cleanup - -Entfernt Mittelstufe Fotos von der Kamera aus der vorübergehenden Verwahrung genommen. - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -### Beschreibung - -Fortgeschrittene Image-Dateien, die in vorübergehender Verwahrung gehalten werden, nach dem Aufruf von `camera.getPicture` entfernt. Gilt nur wenn der Wert von `Camera.sourceType` gleich `Camera.PictureSourceType.CAMERA` und `Camera.destinationType` gleich `Camera.DestinationType.FILE_URI`. - -### Unterstützte Plattformen - -* iOS - -### Beispiel - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } diff --git a/doc/es/README.md b/doc/es/README.md deleted file mode 100644 index 76af1649f..000000000 --- a/doc/es/README.md +++ /dev/null @@ -1,411 +0,0 @@ - - -# cordova-plugin-camera - -[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera) - -Este plugin define un global `navigator.camera` objeto que proporciona una API para tomar fotografías y por elegir imágenes de biblioteca de imágenes del sistema. - -Aunque el objeto está unido al ámbito global `navigator` , no estará disponible hasta después de la `deviceready` evento. - - document.addEventListener ("deviceready", onDeviceReady, false); - function onDeviceReady() {console.log(navigator.camera)}; - - -## Instalación - - cordova plugin add cordova-plugin-camera - - -## API - - * Cámara - * navigator.camera.getPicture(success, fail, options) - * CameraOptions - * CameraPopoverHandle - * CameraPopoverOptions - * Navigator.Camera.Cleanup - -## navigator.camera.getPicture - -Toma una foto con la cámara, o recupera una foto de Galería de imágenes del dispositivo. La imagen se pasa a la devolución de llamada de éxito como un codificado en base64 `String` , o como el URI para el archivo de imagen. El método se devuelve un `CameraPopoverHandle` objeto que puede utilizarse para volver a colocar el popover de selección de archivo. - - navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions); - - -#### Descripción - -El `camera.getPicture` función abre la aplicación de cámara predeterminada del dispositivo que permite a los usuarios ajustar imágenes. Este comportamiento se produce de forma predeterminada, cuando `Camera.sourceType` es igual a `Camera.PictureSourceType.CAMERA` . Una vez que el usuario ajusta la foto, una aplicación de cámara se cierra y se restablecerá la aplicación. - -Si `Camera.sourceType` es `Camera.PictureSourceType.PHOTOLIBRARY` o `Camera.PictureSourceType.SAVEDPHOTOALBUM` , entonces una muestra de diálogo que permite a los usuarios seleccionar una imagen existente. El `camera.getPicture` función devuelve un `CameraPopoverHandle` objeto, que puede utilizarse para volver a colocar el diálogo de selección de imagen, por ejemplo, cuando cambia la orientación del dispositivo. - -El valor devuelto es enviado a la `cameraSuccess` función de callback, en uno de los formatos siguientes, dependiendo del objeto `cameraOptions` : - - * Una `String` que contiene la imagen codificada en base64. - - * Una `String` que representa la ubicación del archivo de imagen en almacenamiento local (por defecto). - -Puedes hacer lo que quieras con la imagen codificada o URI, por ejemplo: - - * Representar la imagen en una etiqueta de ``, como en el ejemplo siguiente - - * Guardar los datos localmente (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.) - - * Enviar los datos a un servidor remoto - -**Nota**: resolución de la foto en los nuevos dispositivos es bastante bueno. Fotos seleccionadas de la Galería del dispositivo no son degradadas a una calidad más baja, incluso si un `quality` se especifica el parámetro. Para evitar problemas con la memoria común, establezca `Camera.destinationType` a `FILE_URI` en lugar de`DATA_URL`. - -#### Plataformas soportadas - -![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png) - -#### Ejemplo - -Tomar una foto y recuperarlo como una imagen codificada en base64: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -Tomar una foto y recuperar la ubicación del archivo de la imagen: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -#### Preferencias (iOS) - - * **CameraUsesGeolocation** (booleano, el valor predeterminado de false). Para la captura de imágenes JPEG, establecido en true para obtener datos de geolocalización en la cabecera EXIF. Esto activará la solicitud de permisos de geolocalización si establecido en true. - - - - -#### Amazon fuego OS rarezas - -Amazon fuego OS utiliza los intentos para poner en marcha la actividad de la cámara del dispositivo para capturar imágenes y en teléfonos con poca memoria, puede matar la actividad Cordova. En este escenario, la imagen no aparezca cuando se restaura la actividad cordova. - -#### Rarezas Android - -Android utiliza los intentos para iniciar la actividad de la cámara del dispositivo para capturar imágenes, y en los teléfonos con poca memoria, puede matar la actividad Cordova. En este escenario, la imagen no aparezca cuando se restaura la actividad Cordova. - -#### Navegador rarezas - -Sólo puede devolver fotos como imagen codificada en base64. - -#### Firefox OS rarezas - -Cámara plugin actualmente se implementa mediante [Actividades Web](https://hacks.mozilla.org/2013/01/introducing-web-activities/). - -#### iOS rarezas - -Incluyendo un JavaScript `alert()` en cualquiera de la devolución de llamada funciones pueden causar problemas. Envuelva la alerta dentro de un `setTimeout()` para permitir que el selector de imagen iOS o popover cerrar completamente antes de la alerta se muestra: - - setTimeout(function() { - // do your thing here! - }, 0); - - -#### Windows Phone 7 rarezas - -Invocando la aplicación de cámara nativa mientras el dispositivo está conectado vía Zune no funciona y desencadena un callback de error. - -#### Rarezas Tizen - -Tizen sólo es compatible con un `destinationType` de `Camera.DestinationType.FILE_URI` y un `sourceType` de`Camera.PictureSourceType.PHOTOLIBRARY`. - -## CameraOptions - -Parámetros opcionales para personalizar la configuración de la cámara. - - {calidad: destinationType 75,: Camera.DestinationType.DATA_URL, sourceType: Camera.PictureSourceType.CAMERA, allowEdit: true, encodingType: Camera.EncodingType.JPEG, targetWidth: 100, targetHeight: 100, popoverOptions: CameraPopoverOptions, saveToPhotoAlbum: falsa}; - - - * **calidad**: calidad de la imagen guardada, expresada en un rango de 0-100, donde 100 es típicamente resolución sin pérdida de compresión del archivo. El valor predeterminado es 50. *(Número)* (Tenga en cuenta que no está disponible información sobre resolución de la cámara). - - * **destinationType**: elegir el formato del valor devuelto. El valor predeterminado es FILE_URI. Definido en `navigator.camera.DestinationType` *(número)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - - * **sourceType**: establecer el origen de la imagen. El valor predeterminado es cámara. Definido en `navigator.camera.PictureSourceType` *(número)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - - * **allowEdit**: permite edición sencilla de imagen antes de la selección. *(Booleano)* - - * **encodingType**: elegir la codificación del archivo de imagen devuelta. Por defecto es JPEG. Definido en `navigator.camera.EncodingType` *(número)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - - * **targetWidth**: ancho en píxeles a escala de la imagen. Debe usarse con **targetHeight**. Proporción se mantiene constante. *(Número)* - - * **targetHeight**: altura en píxeles a escala de la imagen. Debe usarse con **targetWidth**. Proporción se mantiene constante. *(Número)* - - * **mediaType**: definir el tipo de medios para seleccionar. Sólo funciona cuando `PictureSourceType` es `PHOTOLIBRARY` o `SAVEDPHOTOALBUM` . Definido en `nagivator.camera.MediaType` *(número)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. DE FORMA PREDETERMINADA. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - - * **correctOrientation**: rotar la imagen para corregir la orientación del dispositivo durante la captura. *(Booleano)* - - * **saveToPhotoAlbum**: guardar la imagen en el álbum de fotos en el dispositivo después de su captura. *(Booleano)* - - * **popoverOptions**: opciones sólo iOS que especifican popover ubicación en iPad. Definido en`CameraPopoverOptions`. - - * **cameraDirection**: elegir la cámara para usar (o parte posterior-frontal). El valor predeterminado es atrás. Definido en `navigator.camera.Direction` *(número)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -#### Amazon fuego OS rarezas - - * Cualquier valor de `cameraDirection` da como resultado una foto orientada hacia atrás. - - * Ignora el `allowEdit` parámetro. - - * `Camera.PictureSourceType.PHOTOLIBRARY` y `Camera.PictureSourceType.SAVEDPHOTOALBUM` Mostrar el mismo álbum de fotos. - -#### Rarezas Android - - * Cualquier valor de `cameraDirection` da como resultado una foto orientada hacia atrás. - - * Android también utiliza la actividad de cultivo de allowEdit, aunque cultivo debe trabajar y realmente pasar la imagen recortada a Córdoba, el único que funciona constantemente es el integrado con la aplicación de Google Plus fotos. Otros cultivos pueden no funcionar. - - * `Camera.PictureSourceType.PHOTOLIBRARY` y `Camera.PictureSourceType.SAVEDPHOTOALBUM` Mostrar el mismo álbum de fotos. - -#### BlackBerry 10 rarezas - - * Ignora el `quality` parámetro. - - * Ignora el `allowEdit` parámetro. - - * `Camera.MediaType`No se admite. - - * Ignora el `correctOrientation` parámetro. - - * Ignora el `cameraDirection` parámetro. - -#### Firefox OS rarezas - - * Ignora el `quality` parámetro. - - * `Camera.DestinationType`se ignora y es igual a `1` (URI del archivo de imagen) - - * Ignora el `allowEdit` parámetro. - - * Ignora el `PictureSourceType` parámetro (el usuario lo elige en una ventana de diálogo) - - * Ignora el`encodingType` - - * Ignora el `targetWidth` y`targetHeight` - - * `Camera.MediaType`No se admite. - - * Ignora el `correctOrientation` parámetro. - - * Ignora el `cameraDirection` parámetro. - -#### iOS rarezas - - * Establecer `quality` por debajo de 50 para evitar errores de memoria en algunos dispositivos. - - * Cuando se utiliza `destinationType.FILE_URI` , fotos se guardan en el directorio temporal de la aplicación. El contenido del directorio temporal de la aplicación se eliminará cuando finalice la aplicación. - -#### Rarezas Tizen - - * opciones no compatibles - - * siempre devuelve un identificador URI de archivo - -#### Windows Phone 7 y 8 rarezas - - * Ignora el `allowEdit` parámetro. - - * Ignora el `correctOrientation` parámetro. - - * Ignora el `cameraDirection` parámetro. - - * Ignora el `saveToPhotoAlbum` parámetro. IMPORTANTE: Todas las imágenes tomadas con la cámara wp7/8 cordova API siempre se copian en rollo de cámara del teléfono. Dependiendo de la configuración del usuario, esto podría significar también que la imagen es auto-subido a su OneDrive. Esto potencialmente podría significar que la imagen está disponible a una audiencia más amplia que su aplicación previsto. Si un bloqueador para su aplicación, usted necesitará aplicar el CameraCaptureTask como se documenta en msdn: también puede comentar o votar hasta el tema relacionado en el [issue tracker de](https://issues.apache.org/jira/browse/CB-2083) - - * Ignora el `mediaType` propiedad de `cameraOptions` como el SDK de Windows Phone no proporciona una manera para elegir vídeos fototeca. - -## CameraError - -onError función callback que proporciona un mensaje de error. - - function(message) { - // Show a helpful message - } - - -#### Descripción - - * **mensaje**: el mensaje es proporcionado por código nativo del dispositivo. *(String)* - -## cameraSuccess - -onSuccess función callback que proporciona los datos de imagen. - - function(imageData) { - // Do something with the image - } - - -#### Descripción - - * **imageData**: codificación en Base64 de los datos de imagen, *o* el archivo de imagen URI, dependiendo de `cameraOptions` en vigor. *(String)* - -#### Ejemplo - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -Un identificador para el cuadro de diálogo popover creado por`navigator.camera.getPicture`. - -#### Descripción - - * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position. - -#### Plataformas soportadas - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### Ejemplo - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -Sólo iOS parámetros que especifican la dirección ancla elemento ubicación y la flecha de la popover al seleccionar imágenes de biblioteca o álbum de un iPad. - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -#### Descripción - - * **x**: coordenadas de píxeles del elemento de la pantalla en la que anclar el popover x. *(Número)* - - * **y**: coordenada píxeles del elemento de la pantalla en la que anclar el popover. *(Número)* - - * **anchura**: anchura, en píxeles, del elemento sobre el que anclar el popover pantalla. *(Número)* - - * **altura**: alto, en píxeles, del elemento sobre el que anclar el popover pantalla. *(Número)* - - * **arrowDir**: dirección de la flecha en el popover debe apuntar. Definido en `Camera.PopoverArrowDirection` *(número)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -Tenga en cuenta que puede cambiar el tamaño de la popover para ajustar la dirección de la flecha y orientación de la pantalla. Asegúrese de que para tener en cuenta los cambios de orientación cuando se especifica la ubicación del elemento de anclaje. - -## Navigator.Camera.Cleanup - -Elimina intermedio fotos tomadas por la cámara de almacenamiento temporal. - - Navigator.Camera.cleanup (cameraSuccess, cameraError); - - -#### Descripción - -Elimina intermedio archivos de imagen que se mantienen en depósito temporal después de llamar `camera.getPicture` . Se aplica sólo cuando el valor de `Camera.sourceType` es igual a `Camera.PictureSourceType.CAMERA` y el `Camera.destinationType` es igual a`Camera.DestinationType.FILE_URI`. - -#### Plataformas soportadas - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### Ejemplo - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } \ No newline at end of file diff --git a/doc/es/index.md b/doc/es/index.md deleted file mode 100644 index dfd0970b9..000000000 --- a/doc/es/index.md +++ /dev/null @@ -1,391 +0,0 @@ - - -# cordova-plugin-camera - -Este plugin define un global `navigator.camera` objeto que proporciona una API para tomar fotografías y por elegir imágenes de biblioteca de imágenes del sistema. - -Aunque el objeto está unido al ámbito global `navigator` , no estará disponible hasta después de la `deviceready` evento. - - document.addEventListener ("deviceready", onDeviceReady, false); - function onDeviceReady() {console.log(navigator.camera)}; - - -## Instalación - - Cordova plugin agregar cordova-plugin-camera - - -## navigator.camera.getPicture - -Toma una foto con la cámara, o recupera una foto de Galería de imágenes del dispositivo. La imagen se pasa a la devolución de llamada de éxito como un codificado en base64 `String` , o como el URI para el archivo de imagen. El método se devuelve un `CameraPopoverHandle` objeto que puede utilizarse para volver a colocar el popover de selección de archivo. - - navigator.camera.getPicture (cameraSuccess, cameraError, cameraOptions); - - -### Descripción - -El `camera.getPicture` función abre la aplicación de cámara predeterminada del dispositivo que permite a los usuarios ajustar imágenes. Este comportamiento se produce de forma predeterminada, cuando `Camera.sourceType` es igual a `Camera.PictureSourceType.CAMERA` . Una vez que el usuario ajusta la foto, una aplicación de cámara se cierra y se restablecerá la aplicación. - -Si `Camera.sourceType` es `Camera.PictureSourceType.PHOTOLIBRARY` o `Camera.PictureSourceType.SAVEDPHOTOALBUM` , entonces una muestra de diálogo que permite a los usuarios seleccionar una imagen existente. El `camera.getPicture` función devuelve un `CameraPopoverHandle` objeto, que puede utilizarse para volver a colocar el diálogo de selección de imagen, por ejemplo, cuando cambia la orientación del dispositivo. - -El valor devuelto es enviado a la `cameraSuccess` función de callback, en uno de los formatos siguientes, dependiendo del objeto `cameraOptions` : - -* Una `String` que contiene la imagen codificada en base64. - -* Una `String` que representa la ubicación del archivo de imagen en almacenamiento local (por defecto). - -Puedes hacer lo que quieras con la imagen codificada o URI, por ejemplo: - -* Representar la imagen en una etiqueta de ``, como en el ejemplo siguiente - -* Guardar los datos localmente (`LocalStorage`, [Lawnchair][1], etc.) - -* Enviar los datos a un servidor remoto - - [1]: http://brianleroux.github.com/lawnchair/ - -**Nota**: resolución de la foto en los nuevos dispositivos es bastante bueno. Fotos seleccionadas de la Galería del dispositivo no son degradadas a una calidad más baja, incluso si un `quality` se especifica el parámetro. Para evitar problemas con la memoria común, establezca `Camera.destinationType` a `FILE_URI` en lugar de`DATA_URL`. - -### Plataformas soportadas - -* Amazon fire OS -* Android -* BlackBerry 10 -* Explorador -* Firefox OS -* iOS -* Tizen -* Windows Phone 7 y 8 -* Windows 8 - -### Preferencias (iOS) - -* **CameraUsesGeolocation** (booleano, el valor predeterminado de false). Para la captura de imágenes JPEG, establecido en true para obtener datos de geolocalización en la cabecera EXIF. Esto activará la solicitud de permisos de geolocalización si establecido en true. - - - - -### Amazon fuego OS rarezas - -Amazon fuego OS utiliza los intentos para poner en marcha la actividad de la cámara del dispositivo para capturar imágenes y en teléfonos con poca memoria, puede matar la actividad Cordova. En este escenario, la imagen no aparezca cuando se restaura la actividad cordova. - -### Rarezas Android - -Android utiliza los intentos para iniciar la actividad de la cámara del dispositivo para capturar imágenes, y en los teléfonos con poca memoria, puede matar la actividad Cordova. En este escenario, la imagen no aparezca cuando se restaura la actividad Cordova. - -### Navegador rarezas - -Sólo puede devolver fotos como imagen codificada en base64. - -### Firefox OS rarezas - -Cámara plugin actualmente se implementa mediante [Actividades Web][2]. - - [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ - -### iOS rarezas - -Incluyendo un JavaScript `alert()` en cualquiera de la devolución de llamada funciones pueden causar problemas. Envuelva la alerta dentro de un `setTimeout()` para permitir que el selector de imagen iOS o popover cerrar completamente antes de la alerta se muestra: - - setTimeout(function() {/ / Haz lo tuyo aquí!}, 0); - - -### Windows Phone 7 rarezas - -Invocando la aplicación de cámara nativa mientras el dispositivo está conectado vía Zune no funciona y desencadena un callback de error. - -### Rarezas Tizen - -Tizen sólo es compatible con un `destinationType` de `Camera.DestinationType.FILE_URI` y un `sourceType` de`Camera.PictureSourceType.PHOTOLIBRARY`. - -### Ejemplo - -Tomar una foto y recuperarlo como una imagen codificada en base64: - - navigator.camera.getPicture (onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) {var imagen = document.getElementById('myImage'); - Image.src = "datos: image / jpeg; base64," + imageData;} - - function onFail(message) {alert (' falló porque: ' + mensaje);} - - -Tomar una foto y recuperar la ubicación del archivo de la imagen: - - navigator.camera.getPicture (onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) {var imagen = document.getElementById('myImage'); - Image.src = imageURI; - } function onFail(message) {alert (' falló porque: ' + mensaje);} - - -## CameraOptions - -Parámetros opcionales para personalizar la configuración de la cámara. - - {calidad: destinationType 75,: Camera.DestinationType.DATA_URL, sourceType: Camera.PictureSourceType.CAMERA, allowEdit: true, encodingType: Camera.EncodingType.JPEG, targetWidth: 100, targetHeight: 100, popoverOptions: CameraPopoverOptions, saveToPhotoAlbum: falsa}; - - -### Opciones - -* **calidad**: calidad de la imagen guardada, expresada en un rango de 0-100, donde 100 es típicamente resolución sin pérdida de compresión del archivo. El valor predeterminado es 50. *(Número)* (Tenga en cuenta que no está disponible información sobre resolución de la cámara). - -* **destinationType**: elegir el formato del valor devuelto. El valor predeterminado es FILE_URI. Definido en `navigator.camera.DestinationType` *(número)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - -* **sourceType**: establecer el origen de la imagen. El valor predeterminado es cámara. Definido en `navigator.camera.PictureSourceType` *(número)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - -* **allowEdit**: permite edición sencilla de imagen antes de la selección. *(Booleano)* - -* **encodingType**: elegir la codificación del archivo de imagen devuelta. Por defecto es JPEG. Definido en `navigator.camera.EncodingType` *(número)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - -* **targetWidth**: ancho en píxeles a escala de la imagen. Debe usarse con **targetHeight**. Proporción se mantiene constante. *(Número)* - -* **targetHeight**: altura en píxeles a escala de la imagen. Debe usarse con **targetWidth**. Proporción se mantiene constante. *(Número)* - -* **mediaType**: definir el tipo de medios para seleccionar. Sólo funciona cuando `PictureSourceType` es `PHOTOLIBRARY` o `SAVEDPHOTOALBUM` . Definido en `nagivator.camera.MediaType` *(número)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. DE FORMA PREDETERMINADA. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - -* **correctOrientation**: rotar la imagen para corregir la orientación del dispositivo durante la captura. *(Booleano)* - -* **saveToPhotoAlbum**: guardar la imagen en el álbum de fotos en el dispositivo después de su captura. *(Booleano)* - -* **popoverOptions**: opciones sólo iOS que especifican popover ubicación en iPad. Definido en`CameraPopoverOptions`. - -* **cameraDirection**: elegir la cámara para usar (o parte posterior-frontal). El valor predeterminado es atrás. Definido en `navigator.camera.Direction` *(número)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -### Amazon fuego OS rarezas - -* Cualquier valor de `cameraDirection` da como resultado una foto orientada hacia atrás. - -* Ignora el `allowEdit` parámetro. - -* `Camera.PictureSourceType.PHOTOLIBRARY` y `Camera.PictureSourceType.SAVEDPHOTOALBUM` Mostrar el mismo álbum de fotos. - -### Rarezas Android - -* Cualquier valor de `cameraDirection` da como resultado una foto orientada hacia atrás. - -* Ignora el `allowEdit` parámetro. - -* `Camera.PictureSourceType.PHOTOLIBRARY` y `Camera.PictureSourceType.SAVEDPHOTOALBUM` Mostrar el mismo álbum de fotos. - -### BlackBerry 10 rarezas - -* Ignora el `quality` parámetro. - -* Ignora el `allowEdit` parámetro. - -* `Camera.MediaType`No se admite. - -* Ignora el `correctOrientation` parámetro. - -* Ignora el `cameraDirection` parámetro. - -### Firefox OS rarezas - -* Ignora el `quality` parámetro. - -* `Camera.DestinationType`se ignora y es igual a `1` (URI del archivo de imagen) - -* Ignora el `allowEdit` parámetro. - -* Ignora el `PictureSourceType` parámetro (el usuario lo elige en una ventana de diálogo) - -* Ignora el`encodingType` - -* Ignora el `targetWidth` y`targetHeight` - -* `Camera.MediaType`No se admite. - -* Ignora el `correctOrientation` parámetro. - -* Ignora el `cameraDirection` parámetro. - -### iOS rarezas - -* Establecer `quality` por debajo de 50 para evitar errores de memoria en algunos dispositivos. - -* Cuando se utiliza `destinationType.FILE_URI` , fotos se guardan en el directorio temporal de la aplicación. El contenido del directorio temporal de la aplicación se eliminará cuando finalice la aplicación. - -### Rarezas Tizen - -* opciones no compatibles - -* siempre devuelve un identificador URI de archivo - -### Windows Phone 7 y 8 rarezas - -* Ignora el `allowEdit` parámetro. - -* Ignora el `correctOrientation` parámetro. - -* Ignora el `cameraDirection` parámetro. - -* Ignora el `saveToPhotoAlbum` parámetro. IMPORTANTE: Todas las imágenes tomadas con la cámara wp7/8 cordova API siempre se copian en rollo de cámara del teléfono. Dependiendo de la configuración del usuario, esto podría significar también que la imagen es auto-subido a su OneDrive. Esto potencialmente podría significar que la imagen está disponible a una audiencia más amplia que su aplicación previsto. Si un bloqueador para su aplicación, usted necesitará aplicar el CameraCaptureTask como se documenta en msdn: también puede comentar o votar hasta el tema relacionado en el [issue tracker de][3] - -* Ignora el `mediaType` propiedad de `cameraOptions` como el SDK de Windows Phone no proporciona una manera para elegir vídeos fototeca. - - [3]: https://issues.apache.org/jira/browse/CB-2083 - -## CameraError - -onError función callback que proporciona un mensaje de error. - - function(Message) {/ / Mostrar un mensaje útil} - - -### Parámetros - -* **mensaje**: el mensaje es proporcionado por código nativo del dispositivo. *(String)* - -## cameraSuccess - -onSuccess función callback que proporciona los datos de imagen. - - function(ImageData) {/ / hacer algo con la imagen} - - -### Parámetros - -* **imageData**: codificación en Base64 de los datos de imagen, *o* el archivo de imagen URI, dependiendo de `cameraOptions` en vigor. *(String)* - -### Ejemplo - - Mostrar imagen / / function cameraCallback(imageData) {var imagen = document.getElementById('myImage'); - Image.src = "datos: image / jpeg; base64," + imageData;} - - -## CameraPopoverHandle - -Un identificador para el cuadro de diálogo popover creado por`navigator.camera.getPicture`. - -### Métodos - -* **setPosition**: establecer la posición de la popover. - -### Plataformas soportadas - -* iOS - -### setPosition - -Establecer la posición de la popover. - -**Parámetros**: - -* `cameraPopoverOptions`: el `CameraPopoverOptions` que especifican la nueva posición - -### Ejemplo - - var cameraPopoverHandle = navigator.camera.getPicture (onSuccess, onFail, {destinationType: Camera.DestinationType.FILE_URI, sourceType: Camera.PictureSourceType.PHOTOLIBRARY, popoverOptions: CameraPopoverOptions nuevo (300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)}); - - Vuelva a colocar el popover si cambia la orientación. - Window.onorientationchange = function() {var cameraPopoverOptions = new CameraPopoverOptions (0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -Sólo iOS parámetros que especifican la dirección ancla elemento ubicación y la flecha de la popover al seleccionar imágenes de biblioteca o álbum de un iPad. - - {x: 0, y: 32, ancho: 320, altura: 480, arrowDir: Camera.PopoverArrowDirection.ARROW_ANY}; - - -### CameraPopoverOptions - -* **x**: coordenadas de píxeles del elemento de la pantalla en la que anclar el popover x. *(Número)* - -* **y**: coordenada píxeles del elemento de la pantalla en la que anclar el popover. *(Número)* - -* **anchura**: anchura, en píxeles, del elemento sobre el que anclar el popover pantalla. *(Número)* - -* **altura**: alto, en píxeles, del elemento sobre el que anclar el popover pantalla. *(Número)* - -* **arrowDir**: dirección de la flecha en el popover debe apuntar. Definido en `Camera.PopoverArrowDirection` *(número)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -Tenga en cuenta que puede cambiar el tamaño de la popover para ajustar la dirección de la flecha y orientación de la pantalla. Asegúrese de que para tener en cuenta los cambios de orientación cuando se especifica la ubicación del elemento de anclaje. - -## Navigator.Camera.Cleanup - -Elimina intermedio fotos tomadas por la cámara de almacenamiento temporal. - - Navigator.Camera.cleanup (cameraSuccess, cameraError); - - -### Descripción - -Elimina intermedio archivos de imagen que se mantienen en depósito temporal después de llamar `camera.getPicture` . Se aplica sólo cuando el valor de `Camera.sourceType` es igual a `Camera.PictureSourceType.CAMERA` y el `Camera.destinationType` es igual a`Camera.DestinationType.FILE_URI`. - -### Plataformas soportadas - -* iOS - -### Ejemplo - - Navigator.Camera.cleanup (onSuccess, onFail); - - function onSuccess() {console.log ("cámara limpieza éxito.")} - - function onFail(message) {alert (' falló porque: ' + mensaje);} diff --git a/doc/fr/README.md b/doc/fr/README.md deleted file mode 100644 index 091dd2372..000000000 --- a/doc/fr/README.md +++ /dev/null @@ -1,378 +0,0 @@ - - -# cordova-plugin-camera - -[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera) - -Ce plugin définit un global `navigator.camera` objet qui fournit une API pour la prise de photos et de choisir des images de la bibliothèque d'images du système. - -Bien que l'objet est attaché à la portée globale `navigator` , il n'est pas disponible jusqu'après la `deviceready` événement. - - document.addEventListener (« deviceready », onDeviceReady, false) ; - function onDeviceReady() {console.log(navigator.camera);} - - -## Installation - - cordova plugin add cordova-plugin-camera - - -## API - - * Appareil photo - * navigator.camera.getPicture(success, fail, options) - * CameraOptions - * CameraPopoverHandle - * CameraPopoverOptions - * Navigator.Camera.Cleanup - -## navigator.camera.getPicture - -Prend une photo à l'aide de la caméra, ou récupère une photo de la Galerie d'images de l'appareil. L'image est passé au rappel succès comme un codage base64 `String` , ou comme l'URI du fichier de l'image. La méthode elle-même retourne un `CameraPopoverHandle` objet qui permet de repositionner le kangourou de sélection de fichier. - - navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions); - - -#### Description - -Le `camera.getPicture` fonction ouvre l'application de caméra par défaut de l'appareil qui permet aux utilisateurs de prendre des photos. Ce comportement se produit par défaut, lorsque `Camera.sourceType` est égal à `Camera.PictureSourceType.CAMERA` . Une fois que l'utilisateur s'enclenche la photo, l'application appareil photo se ferme et l'application est restaurée. - -Si `Camera.sourceType` est `Camera.PictureSourceType.PHOTOLIBRARY` ou `Camera.PictureSourceType.SAVEDPHOTOALBUM` , puis un dialogue affiche qui permet aux utilisateurs de sélectionner une image existante. Le `camera.getPicture` retourne un `CameraPopoverHandle` objet, ce qui permet de repositionner le dialogue de sélection d'image, par exemple, lorsque l'orientation de l'appareil change. - -La valeur de retour est envoyée à la `cameraSuccess` la fonction de rappel, dans l'un des formats suivants, selon les `cameraOptions` : - - * A `String` contenant l'image photo codée en base64. - - * A `String` qui représente l'emplacement du fichier image sur le stockage local (par défaut). - -Vous pouvez faire ce que vous voulez avec l'image codée ou URI, par exemple : - - * Afficher l'image dans un `` tag, comme dans l'exemple ci-dessous - - * Enregistrer les données localement ( `LocalStorage` , [poids](http://brianleroux.github.com/lawnchair/), etc..) - - * Publier les données sur un serveur distant - -**NOTE**: la résolution de Photo sur les nouveaux appareils est assez bonne. Photos sélectionnées de la Galerie de l'appareil ne sont pas réduites à une baisse de la qualité, même si un `quality` paramètre est spécifié. Pour éviter les problèmes de mémoire commun, définissez `Camera.destinationType` à `FILE_URI` au lieu de`DATA_URL`. - -#### Plates-formes supportées - -![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png) - -#### Exemple - -Prendre une photo, puis extrayez-la comme une image codée en base64 : - - navigator.camera.getPicture (onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }) ; - - function onSuccess(imageData) {var image = document.getElementById('myImage') ; - image.src = "données : image / jpeg ; base64," + imageData;} - - function onFail(message) {alert (' a échoué car: "+ message);} - - -Prendre une photo et récupérer l'emplacement du fichier de l'image : - - navigator.camera.getPicture (onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }) ; - - function onSuccess(imageURI) {var image = document.getElementById('myImage') ; - image.SRC = imageURI ; - } function onFail(message) {alert (' a échoué car: "+ message);} - - -#### Préférences (iOS) - - * **CameraUsesGeolocation** (boolean, par défaut, false). Pour capturer des images JPEG, true pour obtenir des données de géolocalisation dans l'en-tête EXIF. Cela va déclencher une demande d'autorisations de géolocalisation si défini à true. - - - - -#### Amazon Fire OS Quirks - -Amazon Fire OS utilise des intentions pour lancer l'activité de l'appareil photo sur l'appareil pour capturer des images et sur les téléphones avec peu de mémoire, l'activité de Cordova peut être tuée. Dans ce scénario, l'image peut ne pas apparaître lorsque l'activité de cordova est restaurée. - -#### Quirks Android - -Android utilise des intentions pour lancer l'activité de l'appareil photo sur l'appareil pour capturer des images et sur les téléphones avec peu de mémoire, l'activité de Cordova peut être tuée. Dans ce scénario, l'image peut ne pas apparaître lorsque l'activité de Cordova est restaurée. - -#### Bizarreries navigateur - -Peut retourner uniquement les photos comme image codée en base64. - -#### Firefox OS Quirks - -Appareil photo plugin est actuellement mis en œuvre à l'aide [d'Activités sur le Web](https://hacks.mozilla.org/2013/01/introducing-web-activities/). - -#### Notes au sujet d'iOS - -Y compris un JavaScript `alert()` dans les deux le rappel fonctions peuvent causer des problèmes. Envelopper l'alerte dans un `setTimeout()` pour permettre le sélecteur d'image iOS ou kangourou pour fermer entièrement avant que l'alerte s'affiche : - - setTimeout(function() {/ / faire votre truc ici!}, 0) ; - - -#### Windows Phone 7 Quirks - -Invoquant l'application native caméra alors que l'appareil est connecté via Zune ne fonctionne pas et déclenche un rappel de l'erreur. - -#### Bizarreries de paciarelli - -Paciarelli prend uniquement en charge un `destinationType` de `Camera.DestinationType.FILE_URI` et un `sourceType` de`Camera.PictureSourceType.PHOTOLIBRARY`. - -## CameraOptions - -Paramètres optionnels pour personnaliser les réglages de l'appareil. - - {qualité : destinationType 75,: Camera.DestinationType.DATA_URL, TypeSource : Camera.PictureSourceType.CAMERA, allowEdit : encodingType vrai,: Camera.EncodingType.JPEG, targetWidth : 100, targetHeight : 100, popoverOptions : CameraPopoverOptions, saveToPhotoAlbum : false} ; - - - * **qualité**: qualité de l'image enregistrée, exprimée en une gamme de 0 à 100, 100 étant généralement pleine résolution sans perte de compression de fichiers. La valeur par défaut est 50. *(Nombre)* (Notez que les informations sur la résolution de la caméra sont indisponibles). - - * **destinationType**: choisissez le format de la valeur de retour. La valeur par défaut est FILE_URI. Définies dans `navigator.camera.DestinationType` *(nombre)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - - * **sourceType**: définissez la source de l'image. La valeur par défaut est la caméra. Définies dans `navigator.camera.PictureSourceType` *(nombre)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - - * **allowEdit**: permettre un montage simple d'image avant la sélection. *(Booléen)* - - * **encodingType**: choisir le fichier image retournée de codage. Valeur par défaut est JPEG. Définies dans `navigator.camera.EncodingType` *(nombre)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - - * **targetWidth**: largeur en pixels de l'image de l'échelle. Doit être utilisé avec **targetHeight**. Aspect ratio reste constant. *(Nombre)* - - * **targetHeight**: hauteur en pixels de l'image de l'échelle. Doit être utilisé avec **targetWidth**. Aspect ratio reste constant. *(Nombre)* - - * **mediaType**: définir le type de média pour choisir de. Ne fonctionne que quand `PictureSourceType` est `PHOTOLIBRARY` ou `SAVEDPHOTOALBUM` . Définies dans `nagivator.camera.MediaType` *(nombre)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. PAR DÉFAUT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - - * **correctOrientation**: faire pivoter l'image afin de corriger l'orientation de l'appareil lors de la capture. *(Booléen)* - - * **saveToPhotoAlbum**: enregistrer l'image sur l'album photo sur l'appareil après la capture. *(Booléen)* - - * **popoverOptions**: iOS uniquement des options qui spécifient l'emplacement de kangourou dans iPad. Défini dans`CameraPopoverOptions`. - - * **cameraDirection**: choisissez la caméra à utiliser (ou dos-face). La valeur par défaut est de retour. Définies dans `navigator.camera.Direction` *(nombre)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -#### Amazon Fire OS Quirks - - * Tout `cameraDirection` résultats dans le back-face photo de valeur. - - * Ignore la `allowEdit` paramètre. - - * `Camera.PictureSourceType.PHOTOLIBRARY`et `Camera.PictureSourceType.SAVEDPHOTOALBUM` les deux affichent le même album photo. - -#### Quirks Android - - * Tout `cameraDirection` résultats dans le back-face photo de valeur. - - * Android utilise également l'activité de récolte pour allowEdit, même si la récolte doit travailler et transmet en réalité l'image recadrée à Cordoue, le seul que les œuvres sont toujours celui livré avec l'application Google Plus Photos. Autres cultures peuvent ne pas fonctionner. - - * `Camera.PictureSourceType.PHOTOLIBRARY`et `Camera.PictureSourceType.SAVEDPHOTOALBUM` les deux affichent le même album photo. - -#### BlackBerry 10 Quirks - - * Ignore la `quality` paramètre. - - * Ignore la `allowEdit` paramètre. - - * `Camera.MediaType`n'est pas pris en charge. - - * Ignore la `correctOrientation` paramètre. - - * Ignore la `cameraDirection` paramètre. - -#### Firefox OS Quirks - - * Ignore la `quality` paramètre. - - * `Camera.DestinationType`est ignorée et est égal à `1` (URI du fichier image) - - * Ignore la `allowEdit` paramètre. - - * Ignore la `PictureSourceType` paramètre (utilisateur il choisit dans une fenêtre de dialogue) - - * Ignore le`encodingType` - - * Ignore la `targetWidth` et`targetHeight` - - * `Camera.MediaType`n'est pas pris en charge. - - * Ignore la `correctOrientation` paramètre. - - * Ignore la `cameraDirection` paramètre. - -#### Notes au sujet d'iOS - - * La valeur `quality` inférieur à 50 pour éviter les erreurs de mémoire sur certains appareils. - - * Lorsque vous utilisez `destinationType.FILE_URI` , les photos sont sauvegardées dans le répertoire temporaire de l'application. Le contenu du répertoire temporaire de l'application est supprimé lorsque l'application se termine. - -#### Bizarreries de paciarelli - - * options non prises en charge - - * retourne toujours un URI de fichier - -#### Notes au sujet de Windows Phone 7 et 8 - - * Ignore la `allowEdit` paramètre. - - * Ignore la `correctOrientation` paramètre. - - * Ignore la `cameraDirection` paramètre. - - * Ignore la `saveToPhotoAlbum` paramètre. IMPORTANT : Toutes les images prises avec la caméra de cordova wp7/8 API sont toujours copiés au rôle d'appareil photo du téléphone. Selon les paramètres de l'utilisateur, cela pourrait également signifier que l'image est auto-téléchargées à leur OneDrive. Potentiellement, cela pourrait signifier que l'image est disponible à un public plus large que votre application destinée. Si ce un bloqueur pour votre application, vous devrez implémenter le CameraCaptureTask tel que documenté sur msdn : vous pouvez aussi commenter ou haut-vote la question connexe dans le [gestionnaire d'incidents](https://issues.apache.org/jira/browse/CB-2083) - - * Ignore la `mediaType` propriété de `cameraOptions` comme le kit de développement Windows Phone ne fournit pas un moyen de choisir les vidéos de PHOTOLIBRARY. - -## CameraError - -fonction de rappel onError qui fournit un message d'erreur. - - function(message) {/ / afficher un message utile} - - -#### Description - - * **message**: le message est fourni par du code natif de l'appareil. *(String)* - -## cameraSuccess - -fonction de rappel onSuccess qui fournit les données d'image. - - function(ImageData) {/ / faire quelque chose avec l'image} - - -#### Description - - * **imageData**: codage Base64 de l'image, *ou* le fichier image URI, selon `cameraOptions` en vigueur. *(String)* - -#### Exemple - - Afficher image / / function cameraCallback(imageData) {var image = document.getElementById('myImage') ; - image.src = "données : image / jpeg ; base64," + imageData;} - - -## CameraPopoverHandle - -Un handle vers la boîte de dialogue de kangourou créé par`navigator.camera.getPicture`. - -#### Description - - * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position. - -#### Plates-formes supportées - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### Exemple - - var cameraPopoverHandle = navigator.camera.getPicture (onSuccess, onFail, {destinationType : Camera.DestinationType.FILE_URI, TypeSource : Camera.PictureSourceType.PHOTOLIBRARY, popoverOptions : nouvelle CameraPopoverOptions (300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)}) ; - - Repositionner le kangourou si l'orientation change. - Window.onorientationchange = function() {var cameraPopoverOptions = new CameraPopoverOptions (0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) ; - cameraPopoverHandle.setPosition(cameraPopoverOptions) ; - } - - -## CameraPopoverOptions - -iOS uniquement les paramètres qui spécifient la direction ancre élément emplacement et de la flèche de la kangourou lors de la sélection des images de la bibliothèque de l'iPad ou l'album. - - {x: 0, y: 32, largeur : 320, hauteur : 480, arrowDir : Camera.PopoverArrowDirection.ARROW_ANY} ; - - -#### Description - - * **x**: coordonnée de pixel de l'élément de l'écran sur lequel ancrer le kangourou x. *(Nombre)* - - * **y**: coordonnée de y pixels de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)* - - * **largeur**: largeur, en pixels, de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)* - - * **hauteur**: hauteur, en pixels, de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)* - - * **arrowDir**: Direction de la flèche sur le kangourou doit pointer. Définies dans `Camera.PopoverArrowDirection` *(nombre)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -Notez que la taille de la kangourou peut changer pour s'adapter à la direction de la flèche et l'orientation de l'écran. Assurez-vous que tenir compte des changements d'orientation lors de la spécification de l'emplacement d'élément d'ancrage. - -## Navigator.Camera.Cleanup - -Supprime les intermédiaires photos prises par la caméra de stockage temporaire. - - Navigator.Camera.Cleanup (cameraSuccess, cameraError) ; - - -#### Description - -Supprime les intermédiaires les fichiers image qui sont gardées en dépôt temporaire après avoir appelé `camera.getPicture` . S'applique uniquement lorsque la valeur de `Camera.sourceType` est égale à `Camera.PictureSourceType.CAMERA` et le `Camera.destinationType` est égal à`Camera.DestinationType.FILE_URI`. - -#### Plates-formes supportées - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### Exemple - - Navigator.Camera.Cleanup (onSuccess, onFail) ; - - fonction onSuccess() {console.log ("succès de caméra nettoyage.")} - - function onFail(message) {alert (' a échoué car: "+ message);} \ No newline at end of file diff --git a/doc/fr/index.md b/doc/fr/index.md deleted file mode 100644 index ec005f0ac..000000000 --- a/doc/fr/index.md +++ /dev/null @@ -1,391 +0,0 @@ - - -# cordova-plugin-camera - -Ce plugin définit un global `navigator.camera` objet qui fournit une API pour la prise de photos et de choisir des images de la bibliothèque d'images du système. - -Bien que l'objet est attaché à la portée globale `navigator` , il n'est pas disponible jusqu'après la `deviceready` événement. - - document.addEventListener (« deviceready », onDeviceReady, false) ; - function onDeviceReady() {console.log(navigator.camera);} - - -## Installation - - Cordova plugin ajouter cordova-plugin-camera - - -## navigator.camera.getPicture - -Prend une photo à l'aide de la caméra, ou récupère une photo de la Galerie d'images de l'appareil. L'image est passé au rappel succès comme un codage base64 `String` , ou comme l'URI du fichier de l'image. La méthode elle-même retourne un `CameraPopoverHandle` objet qui permet de repositionner le kangourou de sélection de fichier. - - navigator.camera.getPicture (cameraSuccess, cameraError, cameraOptions) ; - - -### Description - -Le `camera.getPicture` fonction ouvre l'application de caméra par défaut de l'appareil qui permet aux utilisateurs de prendre des photos. Ce comportement se produit par défaut, lorsque `Camera.sourceType` est égal à `Camera.PictureSourceType.CAMERA` . Une fois que l'utilisateur s'enclenche la photo, l'application appareil photo se ferme et l'application est restaurée. - -Si `Camera.sourceType` est `Camera.PictureSourceType.PHOTOLIBRARY` ou `Camera.PictureSourceType.SAVEDPHOTOALBUM` , puis un dialogue affiche qui permet aux utilisateurs de sélectionner une image existante. Le `camera.getPicture` retourne un `CameraPopoverHandle` objet, ce qui permet de repositionner le dialogue de sélection d'image, par exemple, lorsque l'orientation de l'appareil change. - -La valeur de retour est envoyée à la `cameraSuccess` la fonction de rappel, dans l'un des formats suivants, selon les `cameraOptions` : - -* A `String` contenant l'image photo codée en base64. - -* A `String` qui représente l'emplacement du fichier image sur le stockage local (par défaut). - -Vous pouvez faire ce que vous voulez avec l'image codée ou URI, par exemple : - -* Afficher l'image dans un `` tag, comme dans l'exemple ci-dessous - -* Enregistrer les données localement ( `LocalStorage` , [poids][1], etc..) - -* Publier les données sur un serveur distant - - [1]: http://brianleroux.github.com/lawnchair/ - -**NOTE**: la résolution de Photo sur les nouveaux appareils est assez bonne. Photos sélectionnées de la Galerie de l'appareil ne sont pas réduites à une baisse de la qualité, même si un `quality` paramètre est spécifié. Pour éviter les problèmes de mémoire commun, définissez `Camera.destinationType` à `FILE_URI` au lieu de`DATA_URL`. - -### Plates-formes prises en charge - -* Amazon Fire OS -* Android -* BlackBerry 10 -* Navigateur -* Firefox OS -* iOS -* Paciarelli -* Windows Phone 7 et 8 -* Windows 8 - -### Préférences (iOS) - -* **CameraUsesGeolocation** (boolean, par défaut, false). Pour capturer des images JPEG, true pour obtenir des données de géolocalisation dans l'en-tête EXIF. Cela va déclencher une demande d'autorisations de géolocalisation si défini à true. - - - - -### Amazon Fire OS Quirks - -Amazon Fire OS utilise des intentions pour lancer l'activité de l'appareil photo sur l'appareil pour capturer des images et sur les téléphones avec peu de mémoire, l'activité de Cordova peut être tuée. Dans ce scénario, l'image peut ne pas apparaître lorsque l'activité de cordova est restaurée. - -### Quirks Android - -Android utilise des intentions pour lancer l'activité de l'appareil photo sur l'appareil pour capturer des images et sur les téléphones avec peu de mémoire, l'activité de Cordova peut être tuée. Dans ce scénario, l'image peut ne pas apparaître lorsque l'activité de Cordova est restaurée. - -### Bizarreries navigateur - -Peut retourner uniquement les photos comme image codée en base64. - -### Firefox OS Quirks - -Appareil photo plugin est actuellement mis en œuvre à l'aide [d'Activités sur le Web][2]. - - [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ - -### iOS Quirks - -Y compris un JavaScript `alert()` dans les deux le rappel fonctions peuvent causer des problèmes. Envelopper l'alerte dans un `setTimeout()` pour permettre le sélecteur d'image iOS ou kangourou pour fermer entièrement avant que l'alerte s'affiche : - - setTimeout(function() {/ / faire votre truc ici!}, 0) ; - - -### Windows Phone 7 Quirks - -Invoquant l'application native caméra alors que l'appareil est connecté via Zune ne fonctionne pas et déclenche un rappel de l'erreur. - -### Bizarreries de paciarelli - -Paciarelli prend uniquement en charge un `destinationType` de `Camera.DestinationType.FILE_URI` et un `sourceType` de`Camera.PictureSourceType.PHOTOLIBRARY`. - -### Exemple - -Prendre une photo, puis extrayez-la comme une image codée en base64 : - - navigator.camera.getPicture (onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }) ; - - function onSuccess(imageData) {var image = document.getElementById('myImage') ; - image.src = "données : image / jpeg ; base64," + imageData;} - - function onFail(message) {alert (' a échoué car: "+ message);} - - -Prendre une photo et récupérer l'emplacement du fichier de l'image : - - navigator.camera.getPicture (onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }) ; - - function onSuccess(imageURI) {var image = document.getElementById('myImage') ; - image.SRC = imageURI ; - } function onFail(message) {alert (' a échoué car: "+ message);} - - -## CameraOptions - -Paramètres optionnels pour personnaliser les réglages de l'appareil. - - {qualité : destinationType 75,: Camera.DestinationType.DATA_URL, TypeSource : Camera.PictureSourceType.CAMERA, allowEdit : encodingType vrai,: Camera.EncodingType.JPEG, targetWidth : 100, targetHeight : 100, popoverOptions : CameraPopoverOptions, saveToPhotoAlbum : false} ; - - -### Options - -* **qualité**: qualité de l'image enregistrée, exprimée en une gamme de 0 à 100, 100 étant généralement pleine résolution sans perte de compression de fichiers. La valeur par défaut est 50. *(Nombre)* (Notez que les informations sur la résolution de la caméra sont indisponibles). - -* **destinationType**: choisissez le format de la valeur de retour. La valeur par défaut est FILE_URI. Définies dans `navigator.camera.DestinationType` *(nombre)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - -* **sourceType**: définissez la source de l'image. La valeur par défaut est la caméra. Définies dans `navigator.camera.PictureSourceType` *(nombre)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - -* **allowEdit**: permettre un montage simple d'image avant la sélection. *(Booléen)* - -* **encodingType**: choisir le fichier image retournée de codage. Valeur par défaut est JPEG. Définies dans `navigator.camera.EncodingType` *(nombre)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - -* **targetWidth**: largeur en pixels de l'image de l'échelle. Doit être utilisé avec **targetHeight**. Aspect ratio reste constant. *(Nombre)* - -* **targetHeight**: hauteur en pixels de l'image de l'échelle. Doit être utilisé avec **targetWidth**. Aspect ratio reste constant. *(Nombre)* - -* **mediaType**: définir le type de média pour choisir de. Ne fonctionne que quand `PictureSourceType` est `PHOTOLIBRARY` ou `SAVEDPHOTOALBUM` . Définies dans `nagivator.camera.MediaType` *(nombre)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. PAR DÉFAUT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - -* **correctOrientation**: faire pivoter l'image afin de corriger l'orientation de l'appareil lors de la capture. *(Booléen)* - -* **saveToPhotoAlbum**: enregistrer l'image sur l'album photo sur l'appareil après la capture. *(Booléen)* - -* **popoverOptions**: iOS uniquement des options qui spécifient l'emplacement de kangourou dans iPad. Défini dans`CameraPopoverOptions`. - -* **cameraDirection**: choisissez la caméra à utiliser (ou dos-face). La valeur par défaut est de retour. Définies dans `navigator.camera.Direction` *(nombre)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -### Amazon Fire OS Quirks - -* Tout `cameraDirection` résultats dans le back-face photo de valeur. - -* Ignore la `allowEdit` paramètre. - -* `Camera.PictureSourceType.PHOTOLIBRARY`et `Camera.PictureSourceType.SAVEDPHOTOALBUM` les deux affichent le même album photo. - -### Quirks Android - -* Tout `cameraDirection` résultats dans le back-face photo de valeur. - -* Ignore la `allowEdit` paramètre. - -* `Camera.PictureSourceType.PHOTOLIBRARY`et `Camera.PictureSourceType.SAVEDPHOTOALBUM` les deux affichent le même album photo. - -### BlackBerry 10 Quirks - -* Ignore la `quality` paramètre. - -* Ignore la `allowEdit` paramètre. - -* `Camera.MediaType`n'est pas pris en charge. - -* Ignore la `correctOrientation` paramètre. - -* Ignore la `cameraDirection` paramètre. - -### Firefox OS Quirks - -* Ignore la `quality` paramètre. - -* `Camera.DestinationType`est ignorée et est égal à `1` (URI du fichier image) - -* Ignore la `allowEdit` paramètre. - -* Ignore la `PictureSourceType` paramètre (utilisateur il choisit dans une fenêtre de dialogue) - -* Ignore le`encodingType` - -* Ignore la `targetWidth` et`targetHeight` - -* `Camera.MediaType`n'est pas pris en charge. - -* Ignore la `correctOrientation` paramètre. - -* Ignore la `cameraDirection` paramètre. - -### iOS Quirks - -* La valeur `quality` inférieur à 50 pour éviter les erreurs de mémoire sur certains appareils. - -* Lorsque vous utilisez `destinationType.FILE_URI` , les photos sont sauvegardées dans le répertoire temporaire de l'application. Le contenu du répertoire temporaire de l'application est supprimé lorsque l'application se termine. - -### Bizarreries de paciarelli - -* options non prises en charge - -* retourne toujours un URI de fichier - -### Windows Phone 7 et 8 Quirks - -* Ignore la `allowEdit` paramètre. - -* Ignore la `correctOrientation` paramètre. - -* Ignore la `cameraDirection` paramètre. - -* Ignore la `saveToPhotoAlbum` paramètre. IMPORTANT : Toutes les images prises avec la caméra de cordova wp7/8 API sont toujours copiés au rôle d'appareil photo du téléphone. Selon les paramètres de l'utilisateur, cela pourrait également signifier que l'image est auto-téléchargées à leur OneDrive. Potentiellement, cela pourrait signifier que l'image est disponible à un public plus large que votre application destinée. Si ce un bloqueur pour votre application, vous devrez implémenter le CameraCaptureTask tel que documenté sur msdn : vous pouvez aussi commenter ou haut-vote la question connexe dans le [gestionnaire d'incidents][3] - -* Ignore la `mediaType` propriété de `cameraOptions` comme le kit de développement Windows Phone ne fournit pas un moyen de choisir les vidéos de PHOTOLIBRARY. - - [3]: https://issues.apache.org/jira/browse/CB-2083 - -## CameraError - -fonction de rappel onError qui fournit un message d'erreur. - - function(message) {/ / afficher un message utile} - - -### Paramètres - -* **message**: le message est fourni par du code natif de l'appareil. *(String)* - -## cameraSuccess - -fonction de rappel onSuccess qui fournit les données d'image. - - function(ImageData) {/ / faire quelque chose avec l'image} - - -### Paramètres - -* **imageData**: codage Base64 de l'image, *ou* le fichier image URI, selon `cameraOptions` en vigueur. *(String)* - -### Exemple - - Afficher image / / function cameraCallback(imageData) {var image = document.getElementById('myImage') ; - image.src = "données : image / jpeg ; base64," + imageData;} - - -## CameraPopoverHandle - -Un handle vers la boîte de dialogue de kangourou créé par`navigator.camera.getPicture`. - -### Méthodes - -* **setPosition**: définir la position de la kangourou. - -### Plates-formes prises en charge - -* iOS - -### setPosition - -Définir la position de la kangourou. - -**Paramètres**: - -* `cameraPopoverOptions`: la `CameraPopoverOptions` qui spécifie la nouvelle position - -### Exemple - - var cameraPopoverHandle = navigator.camera.getPicture (onSuccess, onFail, {destinationType : Camera.DestinationType.FILE_URI, TypeSource : Camera.PictureSourceType.PHOTOLIBRARY, popoverOptions : nouvelle CameraPopoverOptions (300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)}) ; - - Repositionner le kangourou si l'orientation change. - Window.onorientationchange = function() {var cameraPopoverOptions = new CameraPopoverOptions (0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) ; - cameraPopoverHandle.setPosition(cameraPopoverOptions) ; - } - - -## CameraPopoverOptions - -iOS uniquement les paramètres qui spécifient la direction ancre élément emplacement et de la flèche de la kangourou lors de la sélection des images de la bibliothèque de l'iPad ou l'album. - - {x: 0, y: 32, largeur : 320, hauteur : 480, arrowDir : Camera.PopoverArrowDirection.ARROW_ANY} ; - - -### CameraPopoverOptions - -* **x**: coordonnée de pixel de l'élément de l'écran sur lequel ancrer le kangourou x. *(Nombre)* - -* **y**: coordonnée de y pixels de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)* - -* **largeur**: largeur, en pixels, de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)* - -* **hauteur**: hauteur, en pixels, de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)* - -* **arrowDir**: Direction de la flèche sur le kangourou doit pointer. Définies dans `Camera.PopoverArrowDirection` *(nombre)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -Notez que la taille de la kangourou peut changer pour s'adapter à la direction de la flèche et l'orientation de l'écran. Assurez-vous que tenir compte des changements d'orientation lors de la spécification de l'emplacement d'élément d'ancrage. - -## Navigator.Camera.Cleanup - -Supprime les intermédiaires photos prises par la caméra de stockage temporaire. - - Navigator.Camera.Cleanup (cameraSuccess, cameraError) ; - - -### Description - -Supprime les intermédiaires les fichiers image qui sont gardées en dépôt temporaire après avoir appelé `camera.getPicture` . S'applique uniquement lorsque la valeur de `Camera.sourceType` est égale à `Camera.PictureSourceType.CAMERA` et le `Camera.destinationType` est égal à`Camera.DestinationType.FILE_URI`. - -### Plates-formes prises en charge - -* iOS - -### Exemple - - Navigator.Camera.Cleanup (onSuccess, onFail) ; - - fonction onSuccess() {console.log ("succès de caméra nettoyage.")} - - function onFail(message) {alert (' a échoué car: "+ message);} diff --git a/doc/img/android-fail.png b/doc/img/android-fail.png deleted file mode 100644 index f9e4e8628..000000000 Binary files a/doc/img/android-fail.png and /dev/null differ diff --git a/doc/img/android-success.png b/doc/img/android-success.png deleted file mode 100644 index 0bb9abd4a..000000000 Binary files a/doc/img/android-success.png and /dev/null differ diff --git a/doc/img/blackberry-fail.png b/doc/img/blackberry-fail.png deleted file mode 100644 index b89efaf13..000000000 Binary files a/doc/img/blackberry-fail.png and /dev/null differ diff --git a/doc/img/blackberry-success.png b/doc/img/blackberry-success.png deleted file mode 100644 index 286d0b9b8..000000000 Binary files a/doc/img/blackberry-success.png and /dev/null differ diff --git a/doc/img/browser-fail.png b/doc/img/browser-fail.png deleted file mode 100644 index 3894be67d..000000000 Binary files a/doc/img/browser-fail.png and /dev/null differ diff --git a/doc/img/browser-success.png b/doc/img/browser-success.png deleted file mode 100644 index 6c2c000e3..000000000 Binary files a/doc/img/browser-success.png and /dev/null differ diff --git a/doc/img/firefox-fail.png b/doc/img/firefox-fail.png deleted file mode 100644 index 2c6cbd190..000000000 Binary files a/doc/img/firefox-fail.png and /dev/null differ diff --git a/doc/img/firefox-success.png b/doc/img/firefox-success.png deleted file mode 100644 index deb9d24ab..000000000 Binary files a/doc/img/firefox-success.png and /dev/null differ diff --git a/doc/img/fireos-fail.png b/doc/img/fireos-fail.png deleted file mode 100644 index b1e7b9b9e..000000000 Binary files a/doc/img/fireos-fail.png and /dev/null differ diff --git a/doc/img/fireos-success.png b/doc/img/fireos-success.png deleted file mode 100644 index 7b6289e06..000000000 Binary files a/doc/img/fireos-success.png and /dev/null differ diff --git a/doc/img/ios-fail.png b/doc/img/ios-fail.png deleted file mode 100644 index 2d8caf807..000000000 Binary files a/doc/img/ios-fail.png and /dev/null differ diff --git a/doc/img/ios-success.png b/doc/img/ios-success.png deleted file mode 100644 index 3bf3b5ac7..000000000 Binary files a/doc/img/ios-success.png and /dev/null differ diff --git a/doc/img/ubuntu-fail.png b/doc/img/ubuntu-fail.png deleted file mode 100644 index ca82c79fa..000000000 Binary files a/doc/img/ubuntu-fail.png and /dev/null differ diff --git a/doc/img/ubuntu-success.png b/doc/img/ubuntu-success.png deleted file mode 100644 index b15227db7..000000000 Binary files a/doc/img/ubuntu-success.png and /dev/null differ diff --git a/doc/img/windows-fail.png b/doc/img/windows-fail.png deleted file mode 100644 index 982a8cf2b..000000000 Binary files a/doc/img/windows-fail.png and /dev/null differ diff --git a/doc/img/windows-success.png b/doc/img/windows-success.png deleted file mode 100644 index b8ae79bb7..000000000 Binary files a/doc/img/windows-success.png and /dev/null differ diff --git a/doc/img/wp8-fail.png b/doc/img/wp8-fail.png deleted file mode 100644 index 28c458823..000000000 Binary files a/doc/img/wp8-fail.png and /dev/null differ diff --git a/doc/img/wp8-success.png b/doc/img/wp8-success.png deleted file mode 100644 index a37cad697..000000000 Binary files a/doc/img/wp8-success.png and /dev/null differ diff --git a/doc/it/README.md b/doc/it/README.md deleted file mode 100644 index 601f6f175..000000000 --- a/doc/it/README.md +++ /dev/null @@ -1,421 +0,0 @@ - - -# cordova-plugin-camera - -[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera) - -Questo plugin definisce un oggetto globale `navigator.camera`, che fornisce un'API per scattare foto e per aver scelto immagini dalla libreria di immagini del sistema. - -Anche se l'oggetto è associato con ambito globale del `navigator`, non è disponibile fino a dopo l'evento `deviceready`. - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log(navigator.camera); - } - - -## Installazione - - cordova plugin add cordova-plugin-camera - - -## API - - * Fotocamera - * navigator.camera.getPicture(success, fail, options) - * CameraOptions - * CameraPopoverHandle - * CameraPopoverOptions - * navigator.camera.cleanup - -## navigator.camera.getPicture - -Prende una foto utilizzando la fotocamera, o recupera una foto dalla galleria di immagini del dispositivo. L'immagine è passata al callback di successo come `String` con codifica base64, o come l'URI per il file di immagine. Lo stesso metodo restituisce un oggetto `CameraPopoverHandle` che può essere utilizzato per riposizionare il Muffin di selezione file. - - navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions); - - -#### Descrizione - -La funzione `camera.getPicture` apre predefinito fotocamera applicazione il dispositivo che consente agli utenti di scattare foto. Questo comportamento si verifica per impostazione predefinita, quando `Camera.sourceType` è uguale a `Camera.PictureSourceType.CAMERA`. Una volta che l'utente scatta la foto, si chiude l'applicazione fotocamera e l'applicazione viene ripristinato. - -Se `Camera.sourceType` è `Camera.PictureSourceType.PHOTOLIBRARY` o `Camera.PictureSourceType.SAVEDPHOTOALBUM`, una finestra di dialogo Visualizza che permette agli utenti di selezionare un'immagine esistente. La funzione `camera.getPicture` restituisce un oggetto `CameraPopoverHandle` che può essere utilizzato per riposizionare la finestra di selezione immagine, ad esempio, quando l'orientamento del dispositivo. - -Il valore restituito viene inviato alla funzione di callback `cameraSuccess`, in uno dei seguenti formati, a seconda il `cameraOptions` specificato: - - * A `String` contenente l'immagine della foto con codifica base64. - - * A `String` che rappresenta il percorso del file di immagine su archiviazione locale (predefinito). - -Si può fare quello che vuoi con l'immagine codificata o URI, ad esempio: - - * Il rendering dell'immagine in un `` tag, come nell'esempio qui sotto - - * Salvare i dati localmente ( `LocalStorage` , [Lawnchair](http://brianleroux.github.com/lawnchair/), ecc.) - - * Inviare i dati a un server remoto - -**Nota**: risoluzione foto sui più recenti dispositivi è abbastanza buona. Foto selezionate dalla galleria del dispositivo non è percepiranno di qualità inferiore, anche se viene specificato un parametro di `quality`. Per evitare problemi di memoria comune, impostare `Camera.destinationType` `FILE_URI` piuttosto che `DATA_URL`. - -#### Piattaforme supportate - -![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png) - -#### Esempio - -Scattare una foto e recuperarla come un'immagine con codifica base64: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -Scattare una foto e recuperare il percorso del file dell'immagine: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -#### Preferenze (iOS) - - * **CameraUsesGeolocation** (boolean, default è false). Per l'acquisizione di immagini JPEG, impostato su true per ottenere dati di geolocalizzazione nell'intestazione EXIF. Questo innescherà una richiesta per le autorizzazioni di geolocalizzazione, se impostato su true. - - - - -#### Amazon fuoco OS stranezze - -Amazon fuoco OS utilizza intenti a lanciare l'attività della fotocamera sul dispositivo per catturare immagini e sui telefoni con poca memoria, l'attività di Cordova può essere ucciso. In questo scenario, l'immagine potrebbe non apparire quando viene ripristinata l'attività di cordova. - -#### Stranezze Android - -Android utilizza intenti a lanciare l'attività della fotocamera sul dispositivo per catturare immagini e sui telefoni con poca memoria, l'attività di Cordova può essere ucciso. In questo scenario, l'immagine potrebbe non apparire quando viene ripristinata l'attività di Cordova. - -#### Stranezze browser - -Può restituire solo la foto come immagine con codifica base64. - -#### Firefox OS stranezze - -Fotocamera plugin è attualmente implementato mediante [Web Activities](https://hacks.mozilla.org/2013/01/introducing-web-activities/). - -#### iOS stranezze - -Compreso un JavaScript `alert()` in una delle funzioni di callback può causare problemi. Avvolgere l'avviso all'interno di un `setTimeout()` per consentire la selezione immagine iOS o muffin per chiudere completamente la prima che viene visualizzato l'avviso: - - setTimeout(function() { - // do your thing here! - }, 0); - - -#### Windows Phone 7 capricci - -Richiamando l'applicazione nativa fotocamera mentre il dispositivo è collegato tramite Zune non funziona e innesca un callback di errore. - -#### Tizen stranezze - -Tizen supporta solo a `destinationType` di `Camera.DestinationType.FILE_URI` e un `sourceType` di `Camera.PictureSourceType.PHOTOLIBRARY`. - -## CameraOptions - -Parametri opzionali per personalizzare le impostazioni della fotocamera. - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - - * **quality**: qualità dell'immagine salvata, espressa come un intervallo di 0-100, dove 100 è tipicamente piena risoluzione senza perdita di compressione file. Il valore predefinito è 50. *(Numero)* (Si noti che informazioni sulla risoluzione della fotocamera non sono disponibile). - - * **destinationType**: Scegli il formato del valore restituito. Il valore predefinito è FILE_URI. Definito in `navigator.camera.DestinationType` *(numero)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - - * **sourceType**: impostare l'origine dell'immagine. Il valore predefinito è la fotocamera. Definito in `navigator.camera.PictureSourceType` *(numero)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - - * **Proprietà allowEdit**: consentire la semplice modifica dell'immagine prima di selezione. *(Booleano)* - - * **encodingType**: scegliere il file immagine restituita di codifica. Predefinito è JPEG. Definito in `navigator.camera.EncodingType` *(numero)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - - * **targetWidth**: larghezza in pixel all'immagine della scala. Deve essere usato con **targetHeight**. Proporzioni rimane costante. *(Numero)* - - * **targetHeight**: altezza in pixel all'immagine della scala. Deve essere usato con **targetWidth**. Proporzioni rimane costante. *(Numero)* - - * **mediaType**: impostare il tipo di supporto per scegliere da. Funziona solo quando `PictureSourceType` è `PHOTOLIBRARY` o `SAVEDPHOTOALBUM` . Definito in `nagivator.camera.MediaType` *(numero)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. PER IMPOSTAZIONE PREDEFINITA. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - - * **correctOrientation**: ruotare l'immagine per correggere l'orientamento del dispositivo durante l'acquisizione. *(Booleano)* - - * **saveToPhotoAlbum**: salvare l'immagine nell'album di foto sul dispositivo dopo la cattura. *(Booleano)* - - * **popoverOptions**: solo iOS opzioni che specificano la posizione di muffin in iPad. Definito in`CameraPopoverOptions`. - - * **cameraDirection**: scegliere la telecamera da utilizzare (o retro-frontale). Il valore predefinito è tornato. Definito in `navigator.camera.Direction` *(numero)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -#### Amazon fuoco OS stranezze - - * Qualsiasi `cameraDirection` valore i risultati in una foto di lamatura. - - * Ignora il `allowEdit` parametro. - - * `Camera.PictureSourceType.PHOTOLIBRARY`e `Camera.PictureSourceType.SAVEDPHOTOALBUM` entrambi visualizzare l'album fotografico stesso. - -#### Stranezze Android - - * Qualsiasi `cameraDirection` valore i risultati in una foto di lamatura. - - * Android utilizza anche l'attività di ritaglio per allowEdit, anche se raccolto dovrebbe funzionare ed effettivamente passare l'immagine ritagliata a Cordova, l'unico che funziona è sempre quello in bundle con l'applicazione di Google Plus foto. Altre colture potrebbero non funzionare. - - * `Camera.PictureSourceType.PHOTOLIBRARY`e `Camera.PictureSourceType.SAVEDPHOTOALBUM` entrambi visualizzare l'album fotografico stesso. - -#### BlackBerry 10 capricci - - * Ignora il `quality` parametro. - - * Ignora il `allowEdit` parametro. - - * `Camera.MediaType`non è supportato. - - * Ignora il `correctOrientation` parametro. - - * Ignora il `cameraDirection` parametro. - -#### Firefox OS stranezze - - * Ignora il `quality` parametro. - - * `Camera.DestinationType`viene ignorato e corrisponde a `1` (URI del file di immagine) - - * Ignora il `allowEdit` parametro. - - * Ignora il `PictureSourceType` parametro (utente ne sceglie in una finestra di dialogo) - - * Ignora il`encodingType` - - * Ignora le `targetWidth` e`targetHeight` - - * `Camera.MediaType`non è supportato. - - * Ignora il `correctOrientation` parametro. - - * Ignora il `cameraDirection` parametro. - -#### iOS stranezze - - * Impostare `quality` inferiore al 50 per evitare errori di memoria su alcuni dispositivi. - - * Quando si utilizza `destinationType.FILE_URI` , foto vengono salvati nella directory temporanea dell'applicazione. Il contenuto della directory temporanea dell'applicazione viene eliminato quando l'applicazione termina. - -#### Tizen stranezze - - * opzioni non supportate - - * restituisce sempre un URI del FILE - -#### Windows Phone 7 e 8 stranezze - - * Ignora il `allowEdit` parametro. - - * Ignora il `correctOrientation` parametro. - - * Ignora il `cameraDirection` parametro. - - * Ignora il `saveToPhotoAlbum` parametro. IMPORTANTE: Tutte le immagini scattate con la fotocamera di cordova wp7/8 API vengono sempre copiate rotolo fotocamera del telefono cellulare. A seconda delle impostazioni dell'utente, questo potrebbe anche significare che l'immagine viene caricato in automatico a loro OneDrive. Questo potenzialmente potrebbe significare che l'immagine è disponibile a un pubblico più ampio di app destinate. Se questo un blocco dell'applicazione, sarà necessario implementare il CameraCaptureTask come documentato su msdn: si può anche commentare o up-voto la questione correlata nel [tracciatore di problemi](https://issues.apache.org/jira/browse/CB-2083) - - * Ignora la `mediaType` proprietà di `cameraOptions` come il SDK di Windows Phone non fornisce un modo per scegliere il video da PHOTOLIBRARY. - -## CameraError - -funzione di callback onError che fornisce un messaggio di errore. - - function(message) { - // Show a helpful message - } - - -#### Descrizione - - * **message**: il messaggio è fornito dal codice nativo del dispositivo. *(String)* - -## cameraSuccess - -funzione di callback onSuccess che fornisce i dati di immagine. - - function(imageData) { - // Do something with the image - } - - -#### Descrizione - - * **imageData**: Base64 codifica dei dati immagine, *o* il file di immagine URI, a seconda `cameraOptions` in vigore. *(String)* - -#### Esempio - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -Un handle per la finestra di dialogo di muffin creato da `navigator.camera.getPicture`. - -#### Descrizione - - * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position. - -#### Piattaforme supportate - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### Esempio - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -iOS solo parametri che specificano l'ancoraggio elemento posizione e freccia direzione il Muffin quando si selezionano le immagini dalla libreria un iPad o un album. - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -#### Descrizione - - * **x**: pixel coordinata x dell'elemento dello schermo su cui ancorare il muffin. *(Numero)* - - * **y**: coordinata y di pixel dell'elemento dello schermo su cui ancorare il muffin. *(Numero)* - - * **width**: larghezza, in pixel, dell'elemento dello schermo su cui ancorare il muffin. *(Numero)* - - * **height**: altezza, in pixel, dell'elemento dello schermo su cui ancorare il muffin. *(Numero)* - - * **arrowDir**: direzione dovrebbe puntare la freccia il muffin. Definito in `Camera.PopoverArrowDirection` *(numero)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -Si noti che la dimensione del muffin possa cambiare per regolare la direzione della freccia e l'orientamento dello schermo. Assicurarsi che tenere conto di modifiche di orientamento quando si specifica la posizione di elemento di ancoraggio. - -## navigator.camera.cleanup - -Rimuove intermedio foto scattate con la fotocamera da deposito temporaneo. - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -#### Descrizione - -Rimuove i file di immagine intermedia che vengono tenuti in custodia temporanea dopo la chiamata a `camera.getPicture`. Si applica solo quando il valore di `Camera.sourceType` è uguale a `Camera.PictureSourceType.CAMERA` e il `Camera.destinationType` è uguale a `Camera.DestinationType.FILE_URI`. - -#### Piattaforme supportate - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### Esempio - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } \ No newline at end of file diff --git a/doc/it/index.md b/doc/it/index.md deleted file mode 100644 index da0b919f0..000000000 --- a/doc/it/index.md +++ /dev/null @@ -1,434 +0,0 @@ - - -# cordova-plugin-camera - -Questo plugin definisce un oggetto globale `navigator.camera`, che fornisce un'API per scattare foto e per aver scelto immagini dalla libreria di immagini del sistema. - -Anche se l'oggetto è associato con ambito globale del `navigator`, non è disponibile fino a dopo l'evento `deviceready`. - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log(navigator.camera); - } - - -## Installazione - - cordova plugin add cordova-plugin-camera - - -## navigator.camera.getPicture - -Prende una foto utilizzando la fotocamera, o recupera una foto dalla galleria di immagini del dispositivo. L'immagine è passata al callback di successo come `String` con codifica base64, o come l'URI per il file di immagine. Lo stesso metodo restituisce un oggetto `CameraPopoverHandle` che può essere utilizzato per riposizionare il Muffin di selezione file. - - navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions ); - - -### Descrizione - -La funzione `camera.getPicture` apre predefinito fotocamera applicazione il dispositivo che consente agli utenti di scattare foto. Questo comportamento si verifica per impostazione predefinita, quando `Camera.sourceType` è uguale a `Camera.PictureSourceType.CAMERA`. Una volta che l'utente scatta la foto, si chiude l'applicazione fotocamera e l'applicazione viene ripristinato. - -Se `Camera.sourceType` è `Camera.PictureSourceType.PHOTOLIBRARY` o `Camera.PictureSourceType.SAVEDPHOTOALBUM`, una finestra di dialogo Visualizza che permette agli utenti di selezionare un'immagine esistente. La funzione `camera.getPicture` restituisce un oggetto `CameraPopoverHandle` che può essere utilizzato per riposizionare la finestra di selezione immagine, ad esempio, quando l'orientamento del dispositivo. - -Il valore restituito viene inviato alla funzione di callback `cameraSuccess`, in uno dei seguenti formati, a seconda il `cameraOptions` specificato: - -* A `String` contenente l'immagine della foto con codifica base64. - -* A `String` che rappresenta il percorso del file di immagine su archiviazione locale (predefinito). - -Si può fare quello che vuoi con l'immagine codificata o URI, ad esempio: - -* Il rendering dell'immagine in un `` tag, come nell'esempio qui sotto - -* Salvare i dati localmente ( `LocalStorage` , [Lawnchair][1], ecc.) - -* Inviare i dati a un server remoto - - [1]: http://brianleroux.github.com/lawnchair/ - -**Nota**: risoluzione foto sui più recenti dispositivi è abbastanza buona. Foto selezionate dalla galleria del dispositivo non è percepiranno di qualità inferiore, anche se viene specificato un parametro di `quality`. Per evitare problemi di memoria comune, impostare `Camera.destinationType` `FILE_URI` piuttosto che `DATA_URL`. - -### Piattaforme supportate - -* Amazon fuoco OS -* Android -* BlackBerry 10 -* Browser -* Firefox OS -* iOS -* Tizen -* Windows Phone 7 e 8 -* Windows 8 - -### Preferenze (iOS) - -* **CameraUsesGeolocation** (boolean, default è false). Per l'acquisizione di immagini JPEG, impostato su true per ottenere dati di geolocalizzazione nell'intestazione EXIF. Questo innescherà una richiesta per le autorizzazioni di geolocalizzazione, se impostato su true. - - - - -### Amazon fuoco OS stranezze - -Amazon fuoco OS utilizza intenti a lanciare l'attività della fotocamera sul dispositivo per catturare immagini e sui telefoni con poca memoria, l'attività di Cordova può essere ucciso. In questo scenario, l'immagine potrebbe non apparire quando viene ripristinata l'attività di cordova. - -### Stranezze Android - -Android utilizza intenti a lanciare l'attività della fotocamera sul dispositivo per catturare immagini e sui telefoni con poca memoria, l'attività di Cordova può essere ucciso. In questo scenario, l'immagine potrebbe non apparire quando viene ripristinata l'attività di Cordova. - -### Stranezze browser - -Può restituire solo la foto come immagine con codifica base64. - -### Firefox OS stranezze - -Fotocamera plugin è attualmente implementato mediante [Web Activities][2]. - - [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ - -### iOS stranezze - -Compreso un JavaScript `alert()` in una delle funzioni di callback può causare problemi. Avvolgere l'avviso all'interno di un `setTimeout()` per consentire la selezione immagine iOS o muffin per chiudere completamente la prima che viene visualizzato l'avviso: - - setTimeout(function() { - // do your thing here! - }, 0); - - -### Windows Phone 7 stranezze - -Richiamando l'applicazione nativa fotocamera mentre il dispositivo è collegato tramite Zune non funziona e innesca un callback di errore. - -### Tizen stranezze - -Tizen supporta solo a `destinationType` di `Camera.DestinationType.FILE_URI` e un `sourceType` di `Camera.PictureSourceType.PHOTOLIBRARY`. - -### Esempio - -Scattare una foto e recuperarla come un'immagine con codifica base64: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -Scattare una foto e recuperare il percorso del file dell'immagine: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -## CameraOptions - -Parametri opzionali per personalizzare le impostazioni della fotocamera. - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - -### Opzioni - -* **quality**: qualità dell'immagine salvata, espressa come un intervallo di 0-100, dove 100 è tipicamente piena risoluzione senza perdita di compressione file. Il valore predefinito è 50. *(Numero)* (Si noti che informazioni sulla risoluzione della fotocamera non sono disponibile). - -* **destinationType**: Scegli il formato del valore restituito. Il valore predefinito è FILE_URI. Definito in `navigator.camera.DestinationType` *(numero)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - -* **sourceType**: impostare l'origine dell'immagine. Il valore predefinito è la fotocamera. Definito in `navigator.camera.PictureSourceType` *(numero)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - -* **Proprietà allowEdit**: consentire la semplice modifica dell'immagine prima di selezione. *(Booleano)* - -* **encodingType**: scegliere il file immagine restituita di codifica. Predefinito è JPEG. Definito in `navigator.camera.EncodingType` *(numero)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - -* **targetWidth**: larghezza in pixel all'immagine della scala. Deve essere usato con **targetHeight**. Proporzioni rimane costante. *(Numero)* - -* **targetHeight**: altezza in pixel all'immagine della scala. Deve essere usato con **targetWidth**. Proporzioni rimane costante. *(Numero)* - -* **mediaType**: impostare il tipo di supporto per scegliere da. Funziona solo quando `PictureSourceType` è `PHOTOLIBRARY` o `SAVEDPHOTOALBUM` . Definito in `nagivator.camera.MediaType` *(numero)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. PER IMPOSTAZIONE PREDEFINITA. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - -* **correctOrientation**: ruotare l'immagine per correggere l'orientamento del dispositivo durante l'acquisizione. *(Booleano)* - -* **saveToPhotoAlbum**: salvare l'immagine nell'album di foto sul dispositivo dopo la cattura. *(Booleano)* - -* **popoverOptions**: solo iOS opzioni che specificano la posizione di muffin in iPad. Definito in`CameraPopoverOptions`. - -* **cameraDirection**: scegliere la telecamera da utilizzare (o retro-frontale). Il valore predefinito è tornato. Definito in `navigator.camera.Direction` *(numero)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -### Amazon fuoco OS stranezze - -* Qualsiasi `cameraDirection` valore i risultati in una foto di lamatura. - -* Ignora il `allowEdit` parametro. - -* `Camera.PictureSourceType.PHOTOLIBRARY`e `Camera.PictureSourceType.SAVEDPHOTOALBUM` entrambi visualizzare l'album fotografico stesso. - -### Stranezze Android - -* Qualsiasi `cameraDirection` valore i risultati in una foto di lamatura. - -* Ignora il `allowEdit` parametro. - -* `Camera.PictureSourceType.PHOTOLIBRARY`e `Camera.PictureSourceType.SAVEDPHOTOALBUM` entrambi visualizzare l'album fotografico stesso. - -### BlackBerry 10 capricci - -* Ignora il `quality` parametro. - -* Ignora il `allowEdit` parametro. - -* `Camera.MediaType`non è supportato. - -* Ignora il `correctOrientation` parametro. - -* Ignora il `cameraDirection` parametro. - -### Firefox OS stranezze - -* Ignora il `quality` parametro. - -* `Camera.DestinationType`viene ignorato e corrisponde a `1` (URI del file di immagine) - -* Ignora il `allowEdit` parametro. - -* Ignora il `PictureSourceType` parametro (utente ne sceglie in una finestra di dialogo) - -* Ignora il`encodingType` - -* Ignora le `targetWidth` e`targetHeight` - -* `Camera.MediaType`non è supportato. - -* Ignora il `correctOrientation` parametro. - -* Ignora il `cameraDirection` parametro. - -### iOS stranezze - -* Impostare `quality` inferiore al 50 per evitare errori di memoria su alcuni dispositivi. - -* Quando si utilizza `destinationType.FILE_URI` , foto vengono salvati nella directory temporanea dell'applicazione. Il contenuto della directory temporanea dell'applicazione viene eliminato quando l'applicazione termina. - -### Tizen stranezze - -* opzioni non supportate - -* restituisce sempre un URI del FILE - -### Windows Phone 7 e 8 stranezze - -* Ignora il `allowEdit` parametro. - -* Ignora il `correctOrientation` parametro. - -* Ignora il `cameraDirection` parametro. - -* Ignora il `saveToPhotoAlbum` parametro. IMPORTANTE: Tutte le immagini scattate con la fotocamera di cordova wp7/8 API vengono sempre copiate rotolo fotocamera del telefono cellulare. A seconda delle impostazioni dell'utente, questo potrebbe anche significare che l'immagine viene caricato in automatico a loro OneDrive. Questo potenzialmente potrebbe significare che l'immagine è disponibile a un pubblico più ampio di app destinate. Se questo un blocco dell'applicazione, sarà necessario implementare il CameraCaptureTask come documentato su msdn: si può anche commentare o up-voto la questione correlata nel [tracciatore di problemi][3] - -* Ignora la `mediaType` proprietà di `cameraOptions` come il SDK di Windows Phone non fornisce un modo per scegliere il video da PHOTOLIBRARY. - - [3]: https://issues.apache.org/jira/browse/CB-2083 - -## CameraError - -funzione di callback onError che fornisce un messaggio di errore. - - function(message) { - // Show a helpful message - } - - -### Parametri - -* **message**: il messaggio è fornito dal codice nativo del dispositivo. *(String)* - -## cameraSuccess - -funzione di callback onSuccess che fornisce i dati di immagine. - - function(imageData) { - // Do something with the image - } - - -### Parametri - -* **imageData**: Base64 codifica dei dati immagine, *o* il file di immagine URI, a seconda `cameraOptions` in vigore. *(String)* - -### Esempio - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -Un handle per la finestra di dialogo di muffin creato da `navigator.camera.getPicture`. - -### Metodi - -* **setPosition**: impostare la posizione dei muffin. - -### Piattaforme supportate - -* iOS - -### setPosition - -Impostare la posizione dei muffin. - -**Parametri**: - -* `cameraPopoverOptions`: il `CameraPopoverOptions` che specificare la nuova posizione - -### Esempio - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -iOS solo parametri che specificano l'ancoraggio elemento posizione e freccia direzione il Muffin quando si selezionano le immagini dalla libreria un iPad o un album. - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -### CameraPopoverOptions - -* **x**: pixel coordinata x dell'elemento dello schermo su cui ancorare il muffin. *(Numero)* - -* **y**: coordinata y di pixel dell'elemento dello schermo su cui ancorare il muffin. *(Numero)* - -* **width**: larghezza, in pixel, dell'elemento dello schermo su cui ancorare il muffin. *(Numero)* - -* **height**: altezza, in pixel, dell'elemento dello schermo su cui ancorare il muffin. *(Numero)* - -* **arrowDir**: direzione dovrebbe puntare la freccia il muffin. Definito in `Camera.PopoverArrowDirection` *(numero)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -Si noti che la dimensione del muffin possa cambiare per regolare la direzione della freccia e l'orientamento dello schermo. Assicurarsi che tenere conto di modifiche di orientamento quando si specifica la posizione di elemento di ancoraggio. - -## navigator.camera.cleanup - -Rimuove intermedio foto scattate con la fotocamera da deposito temporaneo. - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -### Descrizione - -Rimuove i file di immagine intermedia che vengono tenuti in custodia temporanea dopo la chiamata a `camera.getPicture`. Si applica solo quando il valore di `Camera.sourceType` è uguale a `Camera.PictureSourceType.CAMERA` e il `Camera.destinationType` è uguale a `Camera.DestinationType.FILE_URI`. - -### Piattaforme supportate - -* iOS - -### Esempio - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } diff --git a/doc/ja/README.md b/doc/ja/README.md deleted file mode 100644 index a50c18518..000000000 --- a/doc/ja/README.md +++ /dev/null @@ -1,421 +0,0 @@ - - -# cordova-plugin-camera - -[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera) - -このプラグインは、写真を撮るため、システムのイメージ ライブラリからイメージを選択するために API を提供します、グローバル `navigator.camera` オブジェクトを定義します。 - -オブジェクトは、グローバル スコープの `ナビゲーター` に添付、それがないまで `deviceready` イベントの後。 - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log(navigator.camera); - } - - -## インストール - - cordova plugin add cordova-plugin-camera - - -## API - - * カメラ - * navigator.camera.getPicture(success, fail, options) - * CameraOptions - * CameraPopoverHandle - * CameraPopoverOptions - * navigator.camera.cleanup - -## navigator.camera.getPicture - -カメラを使用して写真を取るか、デバイスの画像ギャラリーから写真を取得します。 イメージが渡されます成功時のコールバックを base64 エンコードされた `文字列`、または、URI としてイメージ ファイル。 メソッド自体はファイル選択ポップ オーバーの位置を変更するために使用できる `CameraPopoverHandle` オブジェクトを返します。 - - navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions); - - -#### 解説 - -`camera.getPicture` 関数は、ユーザーの写真をスナップすることができますデバイスのデフォルト カメラ アプリケーションを開きます。 `Camera.sourceType` が `Camera.PictureSourceType.CAMERA` と等しい場合既定では、この現象が発生します。 ユーザーは写真をスナップ、カメラ アプリケーションを閉じるし、アプリケーションが復元されます。 - -`Camera.sourceType` `Camera.PictureSourceType.PHOTOLIBRARY` または `Camera.PictureSourceType.SAVEDPHOTOALBUM` の場合、ダイアログ ボックスはユーザーを既存のイメージを選択することができますが表示されます。 `camera.getPicture` 関数は、デバイスの向きが変更されたとき、たとえば、イメージの選択ダイアログには、位置を変更するために使用することができます、`CameraPopoverHandle` オブジェクトを返します。 - -戻り値が `cameraSuccess` コールバック関数の指定 `cameraOptions` に応じて、次の形式のいずれかに送信されます。 - - * A `String` 写真の base64 でエンコードされたイメージを含んでいます。 - - * A `String` (既定値) のローカル記憶域上のイメージ ファイルの場所を表します。 - -自由に変更、エンコードされたイメージ、または URI などを行うことができます。 - - * イメージをレンダリングする `` 以下の例のように、タグ - - * ローカル データの保存 ( `LocalStorage` 、 [Lawnchair](http://brianleroux.github.com/lawnchair/)など)。 - - * リモート サーバーにデータを投稿します。 - -**注**: 新しいデバイス上の写真の解像度はかなり良いです。 デバイスのギャラリーから選択した写真は `quality` パラメーターが指定されて場合でも下方の品質に縮小されません。 一般的なメモリの問題を避けるために `DATA_URL` ではなく `FILE_URI` に `Camera.destinationType` を設定します。. - -#### サポートされているプラットフォーム - -![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png) - -#### 例 - -写真を撮るし、base64 エンコード イメージとして取得します。 - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -写真を撮るし、イメージのファイルの場所を取得します。 - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -#### 環境設定 (iOS) - - * **CameraUsesGeolocation**(ブール値、デフォルトは false)。 Jpeg 画像をキャプチャするため EXIF ヘッダーで地理位置情報データを取得する場合は true に設定します。 これは、場合地理位置情報のアクセス許可に対する要求をトリガーする true に設定します。 - - - - -#### アマゾン火 OS 癖 - -アマゾン火 OS イメージをキャプチャするデバイス上のカメラの活動を開始する意図を使用して、メモリの少ない携帯電話、コルドバ活動が殺されるかもしれない。 このシナリオではコルドバ活動が復元されると、イメージが表示されません。 - -#### Android の癖 - -アンドロイド、イメージをキャプチャするデバイス上でカメラのアクティビティを開始する意図を使用し、メモリの少ない携帯電話、コルドバ活動が殺されるかもしれない。 このシナリオではコルドバ活動が復元されると、イメージが表示されません。 - -#### ブラウザーの癖 - -Base64 エンコード イメージとして写真を返すのみことができます。 - -#### Firefox OS 癖 - -カメラのプラグインは現在、[Web アクティビティ](https://hacks.mozilla.org/2013/01/introducing-web-activities/) を使用して実装されていた. - -#### iOS の癖 - -コールバック関数のいずれかの JavaScript `alert()` を含む問題が発生することができます。 IOS イメージ ピッカーまたは完全が終了するまで、警告が表示されますポップ オーバーを許可する `setTimeout()` 内でアラートをラップします。 - - setTimeout(function() { - // do your thing here! - }, 0); - - -#### Windows Phone 7 の癖 - -ネイティブ カメラ アプリケーションを呼び出すと、デバイスが Zune を介して接続されている動作しませんし、エラー コールバックをトリガーします。 - -#### Tizen の癖 - -Tizen のみ `Camera.DestinationType.FILE_URI` の `destinationType` と `Camera.PictureSourceType.PHOTOLIBRARY` の `sourceType` をサポートしています. - -## CameraOptions - -カメラの設定をカスタマイズするオプションのパラメーター。 - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - - * **quality**: 0-100、100 がファイルの圧縮から損失なしで通常のフル解像度の範囲で表される、保存されたイメージの品質。 既定値は 50 です。 *(数)*(カメラの解像度についての情報が利用できないことに注意してください)。 - - * **destinationType**: 戻り値の形式を選択します。既定値は FILE_URI です。定義されている `navigator.camera.DestinationType` *(番号)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - - * **sourceType**: 画像のソースを設定します。既定値は、カメラです。定義されている `navigator.camera.PictureSourceType` *(番号)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - - * **allowEdit**: 単純な選択の前に画像の編集を許可します。*(ブール値)* - - * **encodingType**: 返されるイメージ ファイルのエンコーディングを選択します。デフォルトは JPEG です。定義されている `navigator.camera.EncodingType` *(番号)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - - * **targetWidth**: スケール イメージにピクセル単位の幅。**TargetHeight**を使用する必要があります。縦横比は変わりません。*(数)* - - * **targetHeight**: スケール イメージにピクセル単位の高さ。**TargetWidth**を使用する必要があります。縦横比は変わりません。*(数)* - - * **mediaType**: から選択するメディアの種類を設定します。 場合にのみ働きます `PictureSourceType` は `PHOTOLIBRARY` または `SAVEDPHOTOALBUM` 。 定義されている `nagivator.camera.MediaType` *(番号)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - - * **correctOrientation**: キャプチャ中に、デバイスの向きを修正する画像を回転させます。*(ブール値)* - - * **saveToPhotoAlbum**: キャプチャ後、デバイス上のフォト アルバムに画像を保存します。*(ブール値)* - - * **popoverOptions**: iPad のポップ オーバーの場所を指定する iOS のみのオプションです。定義されています。`CameraPopoverOptions`. - - * **cameraDirection**: (前面または背面側) を使用するカメラを選択します。既定値は戻るです。定義されている `navigator.camera.Direction` *(番号)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -#### アマゾン火 OS 癖 - - * 任意 `cameraDirection` 背面写真で結果の値します。 - - * 無視、 `allowEdit` パラメーター。 - - * `Camera.PictureSourceType.PHOTOLIBRARY``Camera.PictureSourceType.SAVEDPHOTOALBUM`両方のアルバムが表示されます同じ写真。 - -#### Android の癖 - - * 任意 `cameraDirection` 背面写真で結果の値します。 - - * アンドロイドも使用しています作物活性、allowEdit もトリミングする必要があります動作し、実際にトリミングされた画像をコルドバで 1 つだけの作品一貫して Google プラス写真アプリケーションにバンドルされているものであることに渡します。 他の作物が機能しません。 - - * `Camera.PictureSourceType.PHOTOLIBRARY``Camera.PictureSourceType.SAVEDPHOTOALBUM`両方のアルバムが表示されます同じ写真。 - -#### ブラックベリー 10 癖 - - * 無視、 `quality` パラメーター。 - - * 無視、 `allowEdit` パラメーター。 - - * `Camera.MediaType`サポートされていません。 - - * 無視、 `correctOrientation` パラメーター。 - - * 無視、 `cameraDirection` パラメーター。 - -#### Firefox OS 癖 - - * 無視、 `quality` パラメーター。 - - * `Camera.DestinationType`無視され、等しい `1` (イメージ ファイル URI) - - * 無視、 `allowEdit` パラメーター。 - - * 無視、 `PictureSourceType` パラメーター (ユーザーが選択ダイアログ ウィンドウに) - - * 無視します、`encodingType` - - * 無視、 `targetWidth` と`targetHeight` - - * `Camera.MediaType`サポートされていません。 - - * 無視、 `correctOrientation` パラメーター。 - - * 無視、 `cameraDirection` パラメーター。 - -#### iOS の癖 - - * 設定 `quality` 一部のデバイスでメモリ不足エラーを避けるために 50 の下。 - - * 使用する場合 `destinationType.FILE_URI` 、写真、アプリケーションの一時ディレクトリに保存されます。アプリケーションの一時ディレクトリの内容は、アプリケーションの終了時に削除されます。 - -#### Tizen の癖 - - * サポートされていないオプション - - * 常にファイルの URI を返す - -#### Windows Phone 7 と 8 癖 - - * 無視、 `allowEdit` パラメーター。 - - * 無視、 `correctOrientation` パラメーター。 - - * 無視、 `cameraDirection` パラメーター。 - - * 無視、 `saveToPhotoAlbum` パラメーター。 重要: wp7/8 コルドバ カメラ API で撮影したすべての画像は携帯電話のカメラ巻き物に常にコピーします。 ユーザーの設定に応じて、これも、画像はその OneDrive に自動アップロードを意味できます。 イメージは意図したアプリより広い聴衆に利用できる可能性があります可能性があります。 場合は、このアプリケーションのブロッカー、msdn で説明されているように、CameraCaptureTask を実装する必要があります: コメントにすることがありますもかアップ投票関連の問題を[課題追跡システム](https://issues.apache.org/jira/browse/CB-2083)で - - * 無視、 `mediaType` のプロパティ `cameraOptions` として Windows Phone SDK には、フォト ライブラリからビデオを選択する方法は行いません。 - -## CameraError - -エラー メッセージを提供する onError コールバック関数。 - - function(message) { - // Show a helpful message - } - - -#### 解説 - - * **message**: メッセージは、デバイスのネイティブ コードによって提供されます。*(文字列)* - -## cameraSuccess - -画像データを提供する onSuccess コールバック関数。 - - function(imageData) { - // Do something with the image - } - - -#### 解説 - - * **imagedata を扱う**: Base64 エンコード イメージのデータ、*または*画像ファイルによって URI の `cameraOptions` 効果。*(文字列)* - -#### 例 - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -`Navigator.camera.getPicture` によって作成されたポップオーバーパン ダイアログ ボックスへのハンドル. - -#### 解説 - - * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position. - -#### サポートされているプラットフォーム - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### 例 - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -iOS だけ指定パラメーターをポップ オーバーのアンカー要素の場所および矢印方向計算されたライブラリまたはアルバムから画像を選択するとき。 - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -#### 解説 - - * **x**: ピクセルの x 座標画面要素にポップ オーバーのアンカーになります。*(数)* - - * **y**: y ピクセル座標の画面要素にポップ オーバーのアンカーになります。*(数)* - - * **width**: ポップ オーバーのアンカーになる上の画面要素のピクセル単位の幅。*(数)* - - * **height**: ポップ オーバーのアンカーになる上の画面要素のピクセル単位の高さ。*(数)* - - * **arrowDir**: 方向のポップ オーバーで矢印をポイントする必要があります。定義されている `Camera.PopoverArrowDirection` *(番号)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -矢印の方向と、画面の向きを調整するポップ オーバーのサイズを変更可能性がありますに注意してください。 アンカー要素の位置を指定するときの方向の変化を考慮することを確認します。 - -## navigator.camera.cleanup - -削除中間一時ストレージからカメラで撮影した写真。 - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -#### 解説 - -`camera.getPicture` を呼び出した後一時記憶域に保存されている中間画像ファイルを削除します。 `Camera.sourceType` の値が `Camera.PictureSourceType.CAMERA` に等しい、`Camera.destinationType` が `Camera.DestinationType.FILE_URI` と等しいの場合にのみ適用されます。. - -#### サポートされているプラットフォーム - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### 例 - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } \ No newline at end of file diff --git a/doc/ja/index.md b/doc/ja/index.md deleted file mode 100644 index 5bdb3e1b9..000000000 --- a/doc/ja/index.md +++ /dev/null @@ -1,434 +0,0 @@ - - -# cordova-plugin-camera - -このプラグインは、写真を撮るため、システムのイメージ ライブラリからイメージを選択するために API を提供します、グローバル `navigator.camera` オブジェクトを定義します。 - -オブジェクトは、グローバル スコープの `ナビゲーター` に添付、それがないまで `deviceready` イベントの後。 - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log(navigator.camera); - } - - -## インストール - - cordova plugin add cordova-plugin-camera - - -## navigator.camera.getPicture - -カメラを使用して写真を取るか、デバイスの画像ギャラリーから写真を取得します。 イメージが渡されます成功時のコールバックを base64 エンコードされた `文字列`、または、URI としてイメージ ファイル。 メソッド自体はファイル選択ポップ オーバーの位置を変更するために使用できる `CameraPopoverHandle` オブジェクトを返します。 - - navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions ); - - -### 解説 - -`camera.getPicture` 関数は、ユーザーの写真をスナップすることができますデバイスのデフォルト カメラ アプリケーションを開きます。 `Camera.sourceType` が `Camera.PictureSourceType.CAMERA` と等しい場合既定では、この現象が発生します。 ユーザーは写真をスナップ、カメラ アプリケーションを閉じるし、アプリケーションが復元されます。 - -`Camera.sourceType` `Camera.PictureSourceType.PHOTOLIBRARY` または `Camera.PictureSourceType.SAVEDPHOTOALBUM` の場合、ダイアログ ボックスはユーザーを既存のイメージを選択することができますが表示されます。 `camera.getPicture` 関数は、デバイスの向きが変更されたとき、たとえば、イメージの選択ダイアログには、位置を変更するために使用することができます、`CameraPopoverHandle` オブジェクトを返します。 - -戻り値が `cameraSuccess` コールバック関数の指定 `cameraOptions` に応じて、次の形式のいずれかに送信されます。 - -* A `String` 写真の base64 でエンコードされたイメージを含んでいます。 - -* A `String` (既定値) のローカル記憶域上のイメージ ファイルの場所を表します。 - -自由に変更、エンコードされたイメージ、または URI などを行うことができます。 - -* イメージをレンダリングする `` 以下の例のように、タグ - -* ローカル データの保存 ( `LocalStorage` 、 [Lawnchair][1]など)。 - -* リモート サーバーにデータを投稿します。 - - [1]: http://brianleroux.github.com/lawnchair/ - -**注**: 新しいデバイス上の写真の解像度はかなり良いです。 デバイスのギャラリーから選択した写真は `quality` パラメーターが指定されて場合でも下方の品質に縮小されません。 一般的なメモリの問題を避けるために `DATA_URL` ではなく `FILE_URI` に `Camera.destinationType` を設定します。. - -### サポートされているプラットフォーム - -* アマゾン火 OS -* アンドロイド -* ブラックベリー 10 -* ブラウザー -* Firefox の OS -* iOS -* Tizen -* Windows Phone 7 と 8 -* Windows 8 - -### 環境設定 (iOS) - -* **CameraUsesGeolocation**(ブール値、デフォルトは false)。 Jpeg 画像をキャプチャするため EXIF ヘッダーで地理位置情報データを取得する場合は true に設定します。 これは、場合地理位置情報のアクセス許可に対する要求をトリガーする true に設定します。 - - - - -### アマゾン火 OS 癖 - -アマゾン火 OS イメージをキャプチャするデバイス上のカメラの活動を開始する意図を使用して、メモリの少ない携帯電話、コルドバ活動が殺されるかもしれない。 このシナリオではコルドバ活動が復元されると、イメージが表示されません。 - -### Android の癖 - -アンドロイド、イメージをキャプチャするデバイス上でカメラのアクティビティを開始する意図を使用し、メモリの少ない携帯電話、コルドバ活動が殺されるかもしれない。 このシナリオではコルドバ活動が復元されると、イメージが表示されません。 - -### ブラウザーの癖 - -Base64 エンコード イメージとして写真を返すのみことができます。 - -### Firefox OS 癖 - -カメラのプラグインは現在、[Web アクティビティ][2] を使用して実装されていた. - - [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ - -### iOS の癖 - -コールバック関数のいずれかの JavaScript `alert()` を含む問題が発生することができます。 IOS イメージ ピッカーまたは完全が終了するまで、警告が表示されますポップ オーバーを許可する `setTimeout()` 内でアラートをラップします。 - - setTimeout(function() { - // do your thing here! - }, 0); - - -### Windows Phone 7 の癖 - -ネイティブ カメラ アプリケーションを呼び出すと、デバイスが Zune を介して接続されている動作しませんし、エラー コールバックをトリガーします。 - -### Tizen の癖 - -Tizen のみ `Camera.DestinationType.FILE_URI` の `destinationType` と `Camera.PictureSourceType.PHOTOLIBRARY` の `sourceType` をサポートしています. - -### 例 - -写真を撮るし、base64 エンコード イメージとして取得します。 - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -写真を撮るし、イメージのファイルの場所を取得します。 - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -## CameraOptions - -カメラの設定をカスタマイズするオプションのパラメーター。 - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - -### オプション - -* **quality**: 0-100、100 がファイルの圧縮から損失なしで通常のフル解像度の範囲で表される、保存されたイメージの品質。 既定値は 50 です。 *(数)*(カメラの解像度についての情報が利用できないことに注意してください)。 - -* **destinationType**: 戻り値の形式を選択します。既定値は FILE_URI です。定義されている `navigator.camera.DestinationType` *(番号)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - -* **sourceType**: 画像のソースを設定します。既定値は、カメラです。定義されている `navigator.camera.PictureSourceType` *(番号)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - -* **allowEdit**: 単純な選択の前に画像の編集を許可します。*(ブール値)* - -* **encodingType**: 返されるイメージ ファイルのエンコーディングを選択します。デフォルトは JPEG です。定義されている `navigator.camera.EncodingType` *(番号)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - -* **targetWidth**: スケール イメージにピクセル単位の幅。**TargetHeight**を使用する必要があります。縦横比は変わりません。*(数)* - -* **targetHeight**: スケール イメージにピクセル単位の高さ。**TargetWidth**を使用する必要があります。縦横比は変わりません。*(数)* - -* **mediaType**: から選択するメディアの種類を設定します。 場合にのみ働きます `PictureSourceType` は `PHOTOLIBRARY` または `SAVEDPHOTOALBUM` 。 定義されている `nagivator.camera.MediaType` *(番号)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - -* **correctOrientation**: キャプチャ中に、デバイスの向きを修正する画像を回転させます。*(ブール値)* - -* **saveToPhotoAlbum**: キャプチャ後、デバイス上のフォト アルバムに画像を保存します。*(ブール値)* - -* **popoverOptions**: iPad のポップ オーバーの場所を指定する iOS のみのオプションです。定義されています。`CameraPopoverOptions`. - -* **cameraDirection**: (前面または背面側) を使用するカメラを選択します。既定値は戻るです。定義されている `navigator.camera.Direction` *(番号)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -### アマゾン火 OS 癖 - -* 任意 `cameraDirection` 背面写真で結果の値します。 - -* 無視、 `allowEdit` パラメーター。 - -* `Camera.PictureSourceType.PHOTOLIBRARY``Camera.PictureSourceType.SAVEDPHOTOALBUM`両方のアルバムが表示されます同じ写真。 - -### Android の癖 - -* 任意 `cameraDirection` 背面写真で結果の値します。 - -* 無視、 `allowEdit` パラメーター。 - -* `Camera.PictureSourceType.PHOTOLIBRARY``Camera.PictureSourceType.SAVEDPHOTOALBUM`両方のアルバムが表示されます同じ写真。 - -### ブラックベリー 10 癖 - -* 無視、 `quality` パラメーター。 - -* 無視、 `allowEdit` パラメーター。 - -* `Camera.MediaType`サポートされていません。 - -* 無視、 `correctOrientation` パラメーター。 - -* 無視、 `cameraDirection` パラメーター。 - -### Firefox OS 癖 - -* 無視、 `quality` パラメーター。 - -* `Camera.DestinationType`無視され、等しい `1` (イメージ ファイル URI) - -* 無視、 `allowEdit` パラメーター。 - -* 無視、 `PictureSourceType` パラメーター (ユーザーが選択ダイアログ ウィンドウに) - -* 無視します、`encodingType` - -* 無視、 `targetWidth` と`targetHeight` - -* `Camera.MediaType`サポートされていません。 - -* 無視、 `correctOrientation` パラメーター。 - -* 無視、 `cameraDirection` パラメーター。 - -### iOS の癖 - -* 設定 `quality` 一部のデバイスでメモリ不足エラーを避けるために 50 の下。 - -* 使用する場合 `destinationType.FILE_URI` 、写真、アプリケーションの一時ディレクトリに保存されます。アプリケーションの一時ディレクトリの内容は、アプリケーションの終了時に削除されます。 - -### Tizen の癖 - -* サポートされていないオプション - -* 常にファイルの URI を返す - -### Windows Phone 7 と 8 癖 - -* 無視、 `allowEdit` パラメーター。 - -* 無視、 `correctOrientation` パラメーター。 - -* 無視、 `cameraDirection` パラメーター。 - -* 無視、 `saveToPhotoAlbum` パラメーター。 重要: wp7/8 コルドバ カメラ API で撮影したすべての画像は携帯電話のカメラ巻き物に常にコピーします。 ユーザーの設定に応じて、これも、画像はその OneDrive に自動アップロードを意味できます。 イメージは意図したアプリより広い聴衆に利用できる可能性があります可能性があります。 場合は、このアプリケーションのブロッカー、msdn で説明されているように、CameraCaptureTask を実装する必要があります: コメントにすることがありますもかアップ投票関連の問題を[課題追跡システム][3]で - -* 無視、 `mediaType` のプロパティ `cameraOptions` として Windows Phone SDK には、フォト ライブラリからビデオを選択する方法は行いません。 - - [3]: https://issues.apache.org/jira/browse/CB-2083 - -## CameraError - -エラー メッセージを提供する onError コールバック関数。 - - function(message) { - // Show a helpful message - } - - -### パラメーター - -* **message**: メッセージは、デバイスのネイティブ コードによって提供されます。*(文字列)* - -## cameraSuccess - -画像データを提供する onSuccess コールバック関数。 - - function(imageData) { - // Do something with the image - } - - -### パラメーター - -* **imagedata を扱う**: Base64 エンコード イメージのデータ、*または*画像ファイルによって URI の `cameraOptions` 効果。*(文字列)* - -### 例 - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -`Navigator.camera.getPicture` によって作成されたポップオーバーパン ダイアログ ボックスへのハンドル. - -### メソッド - -* **setPosition**: ポップ オーバーの位置を設定します。 - -### サポートされているプラットフォーム - -* iOS - -### setPosition - -ポップ オーバーの位置を設定します。 - -**パラメーター**: - -* `cameraPopoverOptions`:、 `CameraPopoverOptions` の新しい位置を指定します。 - -### 例 - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -iOS だけ指定パラメーターをポップ オーバーのアンカー要素の場所および矢印方向計算されたライブラリまたはアルバムから画像を選択するとき。 - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -### CameraPopoverOptions - -* **x**: ピクセルの x 座標画面要素にポップ オーバーのアンカーになります。*(数)* - -* **y**: y ピクセル座標の画面要素にポップ オーバーのアンカーになります。*(数)* - -* **width**: ポップ オーバーのアンカーになる上の画面要素のピクセル単位の幅。*(数)* - -* **height**: ポップ オーバーのアンカーになる上の画面要素のピクセル単位の高さ。*(数)* - -* **arrowDir**: 方向のポップ オーバーで矢印をポイントする必要があります。定義されている `Camera.PopoverArrowDirection` *(番号)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -矢印の方向と、画面の向きを調整するポップ オーバーのサイズを変更可能性がありますに注意してください。 アンカー要素の位置を指定するときの方向の変化を考慮することを確認します。 - -## navigator.camera.cleanup - -削除中間一時ストレージからカメラで撮影した写真。 - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -### 説明 - -`camera.getPicture` を呼び出した後一時記憶域に保存されている中間画像ファイルを削除します。 `Camera.sourceType` の値が `Camera.PictureSourceType.CAMERA` に等しい、`Camera.destinationType` が `Camera.DestinationType.FILE_URI` と等しいの場合にのみ適用されます。. - -### サポートされているプラットフォーム - -* iOS - -### 例 - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } diff --git a/doc/ko/README.md b/doc/ko/README.md deleted file mode 100644 index 7b7c2153f..000000000 --- a/doc/ko/README.md +++ /dev/null @@ -1,421 +0,0 @@ - - -# cordova-plugin-camera - -[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera) - -이 플러그인 시스템의 이미지 라이브러리에서 이미지를 선택 및 사진 촬영을 위한 API를 제공 하는 글로벌 `navigator.camera` 개체를 정의 합니다. - -개체 `navigator` 글로벌 범위 첨부 아니에요 때까지 사용할 수 있는 `deviceready` 이벤트 후. - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log(navigator.camera); - } - - -## 설치 - - cordova plugin add cordova-plugin-camera - - -## API - - * 카메라 - * navigator.camera.getPicture(success, fail, options) - * CameraOptions - * CameraPopoverHandle - * CameraPopoverOptions - * navigator.camera.cleanup - -## navigator.camera.getPicture - -카메라를 사용 하 여 사진을 걸립니다 또는 소자의 이미지 갤러리에서 사진을 검색 합니다. 이미지는 성공 콜백에 전달 base64 인코딩된 `문자열` 또는 URI로 이미지 파일에 대 한. 방법 자체는 파일 선택 popover 위치를 사용할 수 있는 `CameraPopoverHandle` 개체를 반환 합니다. - - navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions); - - -#### 설명 - -`Camera.getPicture` 함수 스냅 사진을 사용자가 소자의 기본 카메라 응용 프로그램을 엽니다. 이 문제는 `Camera.sourceType` `Camera.PictureSourceType.CAMERA` 경우 기본적으로 발생 합니다. 일단 사용자 스냅 사진, 카메라 응용 프로그램 종료 하 고 응용 프로그램 복원 됩니다. - -`Camera.sourceType`은 `Camera.PictureSourceType.PHOTOLIBRARY` 또는 `Camera.PictureSourceType.SAVEDPHOTOALBUM`, 대화 상자가 사용자가 기존 이미지를 선택할 수 있도록 표시 됩니다. `camera.getPicture` 함수는 장치 방향 변경 될 때 이미지 선택 대화 상자, 예를 들어, 위치를 변경 하려면 사용할 수 있는 `CameraPopoverHandle` 개체를 반환 합니다. - -반환 값은 `cameraSuccess` 콜백 함수 지정된 `cameraOptions`에 따라 다음 형식 중 하나에 전송 됩니다. - - * A `String` base64 인코딩된 사진 이미지를 포함 합니다. - - * A `String` 로컬 저장소 (기본값)의 이미지 파일 위치를 나타내는. - -할 수 있는 당신이 원하는대로 인코딩된 이미지 또는 URI, 예를 들면: - - * 렌더링 이미지는 `` 아래 예제와 같이 태그 - - * 로컬로 데이터를 저장 ( `LocalStorage` , [Lawnchair](http://brianleroux.github.com/lawnchair/), 등.) - - * 원격 서버에 데이터 게시 - -**참고**: 더 새로운 장치에 사진 해상도 아주 좋은. 소자의 갤러리에서 선택 된 사진 `품질` 매개 변수를 지정 하는 경우에 낮은 품질에 관하여 하지는. 일반적인 메모리 문제를 피하기 위해 `DATA_URL` 보다 `FILE_URI` `Camera.destinationType` 설정. - -#### 지원 되는 플랫폼 - -![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png) - -#### 예를 들어 - -촬영 및 base64 인코딩 이미지로 검색: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -촬영 하 고 이미지의 파일 위치를 검색: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -#### 환경 설정 (iOS) - - * **CameraUsesGeolocation** (boolean, 기본값: false)입니다. 캡처 Jpeg, EXIF 헤더에 지리적 데이터를 true로 설정 합니다. 이 경우 위치 정보 사용 권한에 대 한 요청을 일으킬 것 이다 true로 설정 합니다. - - - - -#### 아마존 화재 OS 단점 - -아마존 화재 OS 의도 사용 하 여 이미지 캡처 장치에서 카메라 활동을 시작 하 고 낮은 메모리와 휴대 전화에 코르 도우 바 활동 살해 수 있습니다. 코르도바 활동 복원 되 면이 시나리오에서는 이미지가 나타나지 않을 수 있습니다. - -#### 안 드 로이드 단점 - -안 드 로이드 의도 사용 하 여 이미지 캡처 장치에서 카메라 활동을 시작 하 고 낮은 메모리와 휴대 전화에 코르 도우 바 활동 살해 수 있습니다. 코르도바 활동 복원 되 면이 시나리오에서는 이미지가 나타나지 않을 수 있습니다. - -#### 브라우저 만지면 - -수 base64 인코딩 이미지로 사진을 반환 합니다. - -#### 파이어 폭스 OS 단점 - -카메라 플러그인은 현재 [웹 활동](https://hacks.mozilla.org/2013/01/introducing-web-activities/)를 사용 하 여 구현. - -#### iOS 단점 - -자바 `alert()`를 포함 하 여 콜백 함수 중 하나에 문제가 발생할 수 있습니다. 포장 허용 iOS 이미지 피커 또는 popover를 완벽 하 게 경고를 표시 하기 전에 닫습니다 `setTimeout()` 내에서 경고: - - setTimeout(function() { - // do your thing here! - }, 0); - - -#### Windows Phone 7 단점 - -장치 Zune 통해 연결 된 동안 네이티브 카메라 응용 프로그램을 호출 하면 작동 하지 않습니다 하 고 오류 콜백 트리거합니다. - -#### Tizen 특수 - -`Camera.DestinationType.FILE_URI`의 `destinationType`와 `Camera.PictureSourceType.PHOTOLIBRARY`의 `sourceType` Tizen 지원. - -## CameraOptions - -카메라 설정을 사용자 지정 하는 선택적 매개 변수. - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - - * **품질**: 범위 0-100, 100은 파일 압축에서 손실 없이 일반적으로 전체 해상도 저장된 된 이미지의 품질. 기본값은 50입니다. *(수)* (Note 카메라의 해상도 대 한 정보는 사용할 수 없습니다.) - - * **destinationType**: 반환 값의 형식을 선택 합니다. 기본값은 FILE_URI입니다. 에 정의 된 `navigator.camera.DestinationType` *(수)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - - * **sourceType**: 그림의 소스를 설정 합니다. 기본값은 카메라입니다. 에 정의 된 `navigator.camera.PictureSourceType` *(수)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - - * **allowEdit**: 선택 하기 전에 이미지의 간단한 편집을 허용 합니다. *(부울)* - - * **encodingType**: 반환 된 이미지 파일의 인코딩을 선택 합니다. 기본값은 JPEG입니다. 에 정의 된 `navigator.camera.EncodingType` *(수)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - - * **targetWidth**: 스케일 이미지를 픽셀 너비. **TargetHeight**와 함께 사용 해야 합니다. 가로 세로 비율이 일정 하 게 유지 합니다. *(수)* - - * **targetHeight**: 스케일 이미지를 픽셀 단위로 높이. **TargetWidth**와 함께 사용 해야 합니다. 가로 세로 비율이 일정 하 게 유지 합니다. *(수)* - - * **mediaType**:에서 선택 미디어 유형을 설정 합니다. 때에 작동 `PictureSourceType` 는 `PHOTOLIBRARY` 또는 `SAVEDPHOTOALBUM` . 에 정의 된 `nagivator.camera.MediaType` *(수)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. 기본입니다. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - - * **correctOrientation**: 캡처 도중 장치의 방향에 대 한 해결 하기 위해 이미지를 회전 합니다. *(부울)* - - * **saveToPhotoAlbum**: 캡처 후 장치에서 사진 앨범에 이미지를 저장 합니다. *(부울)* - - * **popoverOptions**: iPad에 popover 위치를 지정 하는 iOS 전용 옵션. 에 정의 된`CameraPopoverOptions`. - - * **cameraDirection**: (앞 이나 뒤로-연결)를 사용 하 여 카메라를 선택 하십시오. 기본값은 다시. 에 정의 된 `navigator.camera.Direction` *(수)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -#### 아마존 화재 OS 단점 - - * 어떤 `cameraDirection` 다시 연결 사진에 결과 값. - - * 무시는 `allowEdit` 매개 변수. - - * `Camera.PictureSourceType.PHOTOLIBRARY`그리고 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 둘 다 동일한 사진 앨범을 표시 합니다. - -#### 안 드 로이드 단점 - - * 어떤 `cameraDirection` 다시 연결 사진에 결과 값. - - * 안 드 로이드도 사용 자르기 활동 allowEdit, 비록 작물 작업과 실제로 코르도바, 유일 하 게 작품 지속적으로 구글 플러스 사진 응용 프로그램과 함께 번들로 제공 하는 것은 등을 맞댄 자른된 이미지를 전달 해야 합니다. 다른 작물은 작동 하지 않을 수 있습니다. - - * `Camera.PictureSourceType.PHOTOLIBRARY`그리고 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 둘 다 동일한 사진 앨범을 표시 합니다. - -#### 블랙베리 10 단점 - - * 무시는 `quality` 매개 변수. - - * 무시는 `allowEdit` 매개 변수. - - * `Camera.MediaType`지원 되지 않습니다. - - * 무시는 `correctOrientation` 매개 변수. - - * 무시는 `cameraDirection` 매개 변수. - -#### 파이어 폭스 OS 단점 - - * 무시는 `quality` 매개 변수. - - * `Camera.DestinationType`무시 되 고 `1` (이미지 파일 URI) - - * 무시는 `allowEdit` 매개 변수. - - * 무시는 `PictureSourceType` 매개 변수 (사용자가 선택 그것 대화 창에서) - - * 무시 하는`encodingType` - - * 무시는 `targetWidth` 와`targetHeight` - - * `Camera.MediaType`지원 되지 않습니다. - - * 무시는 `correctOrientation` 매개 변수. - - * 무시는 `cameraDirection` 매개 변수. - -#### iOS 단점 - - * 설정 `quality` 일부 장치 메모리 오류를 피하기 위해 50 아래. - - * 사용 하는 경우 `destinationType.FILE_URI` , 사진 응용 프로그램의 임시 디렉터리에 저장 됩니다. 응용 프로그램이 종료 될 때 응용 프로그램의 임시 디렉터리의 내용은 삭제 됩니다. - -#### Tizen 특수 - - * 지원 되지 않는 옵션 - - * 항상 파일 URI를 반환 합니다. - -#### Windows Phone 7, 8 특수 - - * 무시는 `allowEdit` 매개 변수. - - * 무시는 `correctOrientation` 매개 변수. - - * 무시는 `cameraDirection` 매개 변수. - - * 무시는 `saveToPhotoAlbum` 매개 변수. 중요: 모든 이미지 API wp7/8 코르도바 카메라로 촬영 항상 복사 됩니다 휴대 전화의 카메라 롤에. 사용자의 설정에 따라이 또한 그들의 OneDrive에 자동 업로드 이미지는 의미. 이 잠재적으로 이미지는 당신의 애플 리 케이 션을 위한 보다 넓은 청중에 게 사용할 수 있는 의미. 이 경우 응용 프로그램에 대 한 차단, 당신은 msdn에 설명 대로 단말기를 구현 해야 합니다: 수 있습니다 또한 의견 또는 [이슈 트래커](https://issues.apache.org/jira/browse/CB-2083) 에서 업-투표 관련된 문제 - - * 무시는 `mediaType` 속성을 `cameraOptions` 으로 Windows Phone SDK PHOTOLIBRARY에서 비디오를 선택 하는 방법을 제공 하지 않습니다. - -## CameraError - -오류 메시지를 제공 하는 onError 콜백 함수. - - function(message) { - // Show a helpful message - } - - -#### 설명 - - * **메시지**: 메시지는 장치의 네이티브 코드에 의해 제공 됩니다. *(문자열)* - -## cameraSuccess - -이미지 데이터를 제공 하는 onSuccess 콜백 함수. - - function(imageData) { - // Do something with the image - } - - -#### 설명 - - * **imageData**: Base64 인코딩은 이미지 데이터, *또는* 이미지 파일에 따라 URI의 `cameraOptions` 적용. *(문자열)* - -#### 예를 들어 - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -`navigator.camera.getPicture`에 의해 만들어진 popover 대화에 대 한 핸들. - -#### 설명 - - * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position. - -#### 지원 되는 플랫폼 - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### 예를 들어 - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -iOS 전용 매개 변수 iPad의 보관 함 또는 앨범에서 이미지를 선택 하면 앵커 요소 위치와 화살표의 방향으로 popover 지정 하는. - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -#### 설명 - - * **x**: x는 popover 앵커는 화면 요소의 픽셀 좌표. *(수)* - - * **y**: y 픽셀 좌표는 popover 앵커는 화면 요소입니다. *(수)* - - * **폭**: 폭 (픽셀)는 popover 앵커는 화면 요소. *(수)* - - * **높이**: 높이 (픽셀)는 popover 앵커는 화면 요소. *(수)* - - * **arrowDir**: 방향 화살표는 popover 가리켜야 합니다. 에 정의 된 `Camera.PopoverArrowDirection` *(수)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -참고는 popover의 크기 조정 화살표 방향 및 화면 방향 변경 될 수 있습니다. 앵커 요소 위치를 지정 하는 경우 방향 변경에 대 한 계정에 있는지 확인 합니다. - -## navigator.camera.cleanup - -제거 임시 저장소에서 카메라로 찍은 사진을 중간. - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -#### 설명 - -`camera.getPicture`를 호출한 후 임시 저장소에 보관 됩니다 중간 이미지 파일을 제거 합니다. `Camera.sourceType` 값은 `Camera.PictureSourceType.CAMERA` 및 `Camera.destinationType`와 `Camera.DestinationType.FILE_URI` 때만 적용 됩니다.. - -#### 지원 되는 플랫폼 - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### 예를 들어 - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } \ No newline at end of file diff --git a/doc/ko/index.md b/doc/ko/index.md deleted file mode 100644 index 794aa9741..000000000 --- a/doc/ko/index.md +++ /dev/null @@ -1,434 +0,0 @@ - - -# cordova-plugin-camera - -이 플러그인 시스템의 이미지 라이브러리에서 이미지를 선택 및 사진 촬영을 위한 API를 제공 하는 글로벌 `navigator.camera` 개체를 정의 합니다. - -개체 `navigator` 글로벌 범위 첨부 아니에요 때까지 사용할 수 있는 `deviceready` 이벤트 후. - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log(navigator.camera); - } - - -## 설치 - - cordova plugin add cordova-plugin-camera - - -## navigator.camera.getPicture - -카메라를 사용 하 여 사진을 걸립니다 또는 소자의 이미지 갤러리에서 사진을 검색 합니다. 이미지는 성공 콜백에 전달 base64 인코딩된 `문자열` 또는 URI로 이미지 파일에 대 한. 방법 자체는 파일 선택 popover 위치를 사용할 수 있는 `CameraPopoverHandle` 개체를 반환 합니다. - - navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions ); - - -### 설명 - -`Camera.getPicture` 함수 스냅 사진을 사용자가 소자의 기본 카메라 응용 프로그램을 엽니다. 이 문제는 `Camera.sourceType` `Camera.PictureSourceType.CAMERA` 경우 기본적으로 발생 합니다. 일단 사용자 스냅 사진, 카메라 응용 프로그램 종료 하 고 응용 프로그램 복원 됩니다. - -`Camera.sourceType`은 `Camera.PictureSourceType.PHOTOLIBRARY` 또는 `Camera.PictureSourceType.SAVEDPHOTOALBUM`, 대화 상자가 사용자가 기존 이미지를 선택할 수 있도록 표시 됩니다. `camera.getPicture` 함수는 장치 방향 변경 될 때 이미지 선택 대화 상자, 예를 들어, 위치를 변경 하려면 사용할 수 있는 `CameraPopoverHandle` 개체를 반환 합니다. - -반환 값은 `cameraSuccess` 콜백 함수 지정된 `cameraOptions`에 따라 다음 형식 중 하나에 전송 됩니다. - -* A `String` base64 인코딩된 사진 이미지를 포함 합니다. - -* A `String` 로컬 저장소 (기본값)의 이미지 파일 위치를 나타내는. - -할 수 있는 당신이 원하는대로 인코딩된 이미지 또는 URI, 예를 들면: - -* 렌더링 이미지는 `` 아래 예제와 같이 태그 - -* 로컬로 데이터를 저장 ( `LocalStorage` , [Lawnchair][1], 등.) - -* 원격 서버에 데이터 게시 - - [1]: http://brianleroux.github.com/lawnchair/ - -**참고**: 더 새로운 장치에 사진 해상도 아주 좋은. 소자의 갤러리에서 선택 된 사진 `품질` 매개 변수를 지정 하는 경우에 낮은 품질에 관하여 하지는. 일반적인 메모리 문제를 피하기 위해 `DATA_URL` 보다 `FILE_URI` `Camera.destinationType` 설정. - -### 지원 되는 플랫폼 - -* 아마존 화재 운영 체제 -* 안 드 로이드 -* 블랙베리 10 -* 브라우저 -* Firefox 운영 체제 -* iOS -* Tizen -* Windows Phone 7과 8 -* 윈도우 8 - -### 환경 설정 (iOS) - -* **CameraUsesGeolocation** (boolean, 기본값: false)입니다. 캡처 Jpeg, EXIF 헤더에 지리적 데이터를 true로 설정 합니다. 이 경우 위치 정보 사용 권한에 대 한 요청을 일으킬 것 이다 true로 설정 합니다. - - - - -### 아마존 화재 OS 단점 - -아마존 화재 OS 의도 사용 하 여 이미지 캡처 장치에서 카메라 활동을 시작 하 고 낮은 메모리와 휴대 전화에 코르 도우 바 활동 살해 수 있습니다. 코르도바 활동 복원 되 면이 시나리오에서는 이미지가 나타나지 않을 수 있습니다. - -### 안 드 로이드 단점 - -안 드 로이드 의도 사용 하 여 이미지 캡처 장치에서 카메라 활동을 시작 하 고 낮은 메모리와 휴대 전화에 코르 도우 바 활동 살해 수 있습니다. 코르도바 활동 복원 되 면이 시나리오에서는 이미지가 나타나지 않을 수 있습니다. - -### 브라우저 만지면 - -수 base64 인코딩 이미지로 사진을 반환 합니다. - -### 파이어 폭스 OS 단점 - -카메라 플러그인은 현재 [웹 활동][2]를 사용 하 여 구현. - - [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ - -### iOS 단점 - -자바 `alert()`를 포함 하 여 콜백 함수 중 하나에 문제가 발생할 수 있습니다. 포장 허용 iOS 이미지 피커 또는 popover를 완벽 하 게 경고를 표시 하기 전에 닫습니다 `setTimeout()` 내에서 경고: - - setTimeout(function() { - // do your thing here! - }, 0); - - -### Windows Phone 7 단점 - -장치 Zune 통해 연결 된 동안 네이티브 카메라 응용 프로그램을 호출 하면 작동 하지 않습니다 하 고 오류 콜백 트리거합니다. - -### Tizen 특수 - -`Camera.DestinationType.FILE_URI`의 `destinationType`와 `Camera.PictureSourceType.PHOTOLIBRARY`의 `sourceType` Tizen 지원. - -### 예를 들어 - -촬영 및 base64 인코딩 이미지로 검색: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -촬영 하 고 이미지의 파일 위치를 검색: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -## CameraOptions - -카메라 설정을 사용자 지정 하는 선택적 매개 변수. - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - -### 옵션 - -* **품질**: 범위 0-100, 100은 파일 압축에서 손실 없이 일반적으로 전체 해상도 저장된 된 이미지의 품질. 기본값은 50입니다. *(수)* (Note 카메라의 해상도 대 한 정보는 사용할 수 없습니다.) - -* **destinationType**: 반환 값의 형식을 선택 합니다. 기본값은 FILE_URI입니다. 에 정의 된 `navigator.camera.DestinationType` *(수)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - -* **sourceType**: 그림의 소스를 설정 합니다. 기본값은 카메라입니다. 에 정의 된 `navigator.camera.PictureSourceType` *(수)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - -* **allowEdit**: 선택 하기 전에 이미지의 간단한 편집을 허용 합니다. *(부울)* - -* **encodingType**: 반환 된 이미지 파일의 인코딩을 선택 합니다. 기본값은 JPEG입니다. 에 정의 된 `navigator.camera.EncodingType` *(수)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - -* **targetWidth**: 스케일 이미지를 픽셀 너비. **TargetHeight**와 함께 사용 해야 합니다. 가로 세로 비율이 일정 하 게 유지 합니다. *(수)* - -* **targetHeight**: 스케일 이미지를 픽셀 단위로 높이. **TargetWidth**와 함께 사용 해야 합니다. 가로 세로 비율이 일정 하 게 유지 합니다. *(수)* - -* **mediaType**:에서 선택 미디어 유형을 설정 합니다. 때에 작동 `PictureSourceType` 는 `PHOTOLIBRARY` 또는 `SAVEDPHOTOALBUM` . 에 정의 된 `nagivator.camera.MediaType` *(수)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. 기본입니다. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - -* **correctOrientation**: 캡처 도중 장치의 방향에 대 한 해결 하기 위해 이미지를 회전 합니다. *(부울)* - -* **saveToPhotoAlbum**: 캡처 후 장치에서 사진 앨범에 이미지를 저장 합니다. *(부울)* - -* **popoverOptions**: iPad에 popover 위치를 지정 하는 iOS 전용 옵션. 에 정의 된`CameraPopoverOptions`. - -* **cameraDirection**: (앞 이나 뒤로-연결)를 사용 하 여 카메라를 선택 하십시오. 기본값은 다시. 에 정의 된 `navigator.camera.Direction` *(수)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -### 아마존 화재 OS 단점 - -* 어떤 `cameraDirection` 다시 연결 사진에 결과 값. - -* 무시는 `allowEdit` 매개 변수. - -* `Camera.PictureSourceType.PHOTOLIBRARY`그리고 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 둘 다 동일한 사진 앨범을 표시 합니다. - -### 안 드 로이드 단점 - -* 어떤 `cameraDirection` 다시 연결 사진에 결과 값. - -* 무시는 `allowEdit` 매개 변수. - -* `Camera.PictureSourceType.PHOTOLIBRARY`그리고 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 둘 다 동일한 사진 앨범을 표시 합니다. - -### 블랙베리 10 단점 - -* 무시는 `quality` 매개 변수. - -* 무시는 `allowEdit` 매개 변수. - -* `Camera.MediaType`지원 되지 않습니다. - -* 무시는 `correctOrientation` 매개 변수. - -* 무시는 `cameraDirection` 매개 변수. - -### 파이어 폭스 OS 단점 - -* 무시는 `quality` 매개 변수. - -* `Camera.DestinationType`무시 되 고 `1` (이미지 파일 URI) - -* 무시는 `allowEdit` 매개 변수. - -* 무시는 `PictureSourceType` 매개 변수 (사용자가 선택 그것 대화 창에서) - -* 무시 하는`encodingType` - -* 무시는 `targetWidth` 와`targetHeight` - -* `Camera.MediaType`지원 되지 않습니다. - -* 무시는 `correctOrientation` 매개 변수. - -* 무시는 `cameraDirection` 매개 변수. - -### iOS 단점 - -* 설정 `quality` 일부 장치 메모리 오류를 피하기 위해 50 아래. - -* 사용 하는 경우 `destinationType.FILE_URI` , 사진 응용 프로그램의 임시 디렉터리에 저장 됩니다. 응용 프로그램이 종료 될 때 응용 프로그램의 임시 디렉터리의 내용은 삭제 됩니다. - -### Tizen 특수 - -* 지원 되지 않는 옵션 - -* 항상 파일 URI를 반환 합니다. - -### Windows Phone 7, 8 특수 - -* 무시는 `allowEdit` 매개 변수. - -* 무시는 `correctOrientation` 매개 변수. - -* 무시는 `cameraDirection` 매개 변수. - -* 무시는 `saveToPhotoAlbum` 매개 변수. 중요: 모든 이미지 API wp7/8 코르도바 카메라로 촬영 항상 복사 됩니다 휴대 전화의 카메라 롤에. 사용자의 설정에 따라이 또한 그들의 OneDrive에 자동 업로드 이미지는 의미. 이 잠재적으로 이미지는 당신의 애플 리 케이 션을 위한 보다 넓은 청중에 게 사용할 수 있는 의미. 이 경우 응용 프로그램에 대 한 차단, 당신은 msdn에 설명 대로 단말기를 구현 해야 합니다: 수 있습니다 또한 의견 또는 [이슈 트래커][3] 에서 업-투표 관련된 문제 - -* 무시는 `mediaType` 속성을 `cameraOptions` 으로 Windows Phone SDK PHOTOLIBRARY에서 비디오를 선택 하는 방법을 제공 하지 않습니다. - - [3]: https://issues.apache.org/jira/browse/CB-2083 - -## CameraError - -오류 메시지를 제공 하는 onError 콜백 함수. - - function(message) { - // Show a helpful message - } - - -### 매개 변수 - -* **메시지**: 메시지는 장치의 네이티브 코드에 의해 제공 됩니다. *(문자열)* - -## cameraSuccess - -이미지 데이터를 제공 하는 onSuccess 콜백 함수. - - function(imageData) { - // Do something with the image - } - - -### 매개 변수 - -* **imageData**: Base64 인코딩은 이미지 데이터, *또는* 이미지 파일에 따라 URI의 `cameraOptions` 적용. *(문자열)* - -### 예를 들어 - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -`navigator.camera.getPicture`에 의해 만들어진 popover 대화에 대 한 핸들. - -### 메서드 - -* **setPosition**:는 popover의 위치를 설정 합니다. - -### 지원 되는 플랫폼 - -* iOS - -### setPosition - -popover의 위치를 설정 합니다. - -**매개 변수**: - -* `cameraPopoverOptions`:는 `CameraPopoverOptions` 새 위치를 지정 하는 - -### 예를 들어 - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -iOS 전용 매개 변수 iPad의 보관 함 또는 앨범에서 이미지를 선택 하면 앵커 요소 위치와 화살표의 방향으로 popover 지정 하는. - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -### CameraPopoverOptions - -* **x**: x는 popover 앵커는 화면 요소의 픽셀 좌표. *(수)* - -* **y**: y 픽셀 좌표는 popover 앵커는 화면 요소입니다. *(수)* - -* **폭**: 폭 (픽셀)는 popover 앵커는 화면 요소. *(수)* - -* **높이**: 높이 (픽셀)는 popover 앵커는 화면 요소. *(수)* - -* **arrowDir**: 방향 화살표는 popover 가리켜야 합니다. 에 정의 된 `Camera.PopoverArrowDirection` *(수)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -참고는 popover의 크기 조정 화살표 방향 및 화면 방향 변경 될 수 있습니다. 앵커 요소 위치를 지정 하는 경우 방향 변경에 대 한 계정에 있는지 확인 합니다. - -## navigator.camera.cleanup - -제거 임시 저장소에서 카메라로 찍은 사진을 중간. - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -### 설명 - -`camera.getPicture`를 호출한 후 임시 저장소에 보관 됩니다 중간 이미지 파일을 제거 합니다. `Camera.sourceType` 값은 `Camera.PictureSourceType.CAMERA` 및 `Camera.destinationType`와 `Camera.DestinationType.FILE_URI` 때만 적용 됩니다.. - -### 지원 되는 플랫폼 - -* iOS - -### 예를 들어 - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } diff --git a/doc/pl/README.md b/doc/pl/README.md deleted file mode 100644 index e7b9d4481..000000000 --- a/doc/pl/README.md +++ /dev/null @@ -1,421 +0,0 @@ - - -# cordova-plugin-camera - -[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera) - -Ten plugin definiuje obiekt globalny `navigator.camera`, który dostarcza API do robienia zdjęć i wybór zdjęć z biblioteki obrazów systemu. - -Mimo, że obiekt jest dołączony do globalnego zakresu `navigator`, to nie dostępne dopiero po zdarzeniu `deviceready`. - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log(navigator.camera); - } - - -## Instalacja - - cordova plugin add cordova-plugin-camera - - -## API - - * Aparat - * navigator.camera.getPicture(success, fail, options) - * CameraOptions - * CameraPopoverHandle - * CameraPopoverOptions - * navigator.camera.cleanup - -## navigator.camera.getPicture - -Ma zdjęcia za pomocą aparatu, lub pobiera zdjęcia z urządzenia Galeria zdjęć. Obraz jest przekazywany do wywołania zwrotnego sukces jako kodowane algorytmem base64 `ciąg`, lub identyfikator URI dla pliku obrazu. Sama metoda zwraca obiekt `CameraPopoverHandle`, który może służyć do zmiany położenia pliku wyboru popover. - - navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions); - - -#### Opis - -Funkcja `camera.getPicture` otwiera urządzenia domyślnej aplikacji aparat fotograficzny ów pozwala użytkownik wobec chwycić zębami kino. To zachowanie występuje domyślnie, gdy `Camera.sourceType` jest równa `Camera.PictureSourceType.CAMERA`. Gdy użytkownik zaskoczy zdjęcie, ten aparat fotograficzny applicationâ zamyka i aplikacji jest przywracany. - -Jeśli `Camera.sourceType` jest równe `Camera.PictureSourceType.PHOTOLIBRARY` lub `Camera.PictureSourceType.SAVEDPHOTOALBUM`, wtedy zostanie wyświetlone okno dialogowe pozwalające użytkownikowi na wybór istniejącego obrazu. Funkcja `camera.getPicture` zwraca obiekt `CameraPopoverHandle`, który obsługuje zmianę położenia okna wyboru obrazu, np. po zmianie orientacji urządzenia. - -Zwracana wartość jest wysyłany do funkcji wywołania zwrotnego `cameraSuccess`, w jednym z następujących formatów, w zależności od określonego `cameraOptions`: - - * `String` zawierający obraz zakodowany przy pomocy base64. - - * `String` reprezentujący lokalizację pliku obrazu w lokalnym magazynie (domyślnie). - -Może rób, co chcesz z zakodowany obraz lub identyfikatora URI, na przykład: - - * Przedstawić obraz w tagu ``, jak w przykładzie poniżej - - * Zapisać lokalnie dane (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.) - - * Wysłać dane na zdalny serwer - -**Uwaga**: zdjęcie rozdzielczości na nowsze urządzenia jest bardzo dobry. Zdjęcia wybrane z galerii urządzenia są nie przeskalowanych w dół do niższej jakości, nawet jeśli określono parametr `quality`. Aby uniknąć typowych problemów z pamięci, zestaw `Camera.destinationType` `FILE_URI` zamiast `DATA_URL`. - -#### Obsługiwane platformy - -![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png) - -#### Przykład - -Zrób zdjęcie i pobrać go jako kodowane algorytmem base64 obrazu: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -Zrób zdjęcie i pobrać lokalizacji pliku obrazu: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -#### Preferencje (iOS) - - * **CameraUsesGeolocation** (boolean, wartość domyślna to false). Do przechwytywania JPEG, zestaw do true, aby uzyskać danych geolokalizacyjnych w nagłówku EXIF. To spowoduje wniosek o geolokalizacji uprawnienia, jeśli zestaw na wartość true. - - - - -#### Amazon ogień OS dziwactwa - -Amazon ogień OS używa intencje do rozpoczęcia działalności aparatu na urządzenie do przechwytywania obrazów, i na telefony z pamięci, Cordova aktywność może zostać zabity. W tym scenariuszu obraz mogą nie być wyświetlane po przywróceniu aktywności cordova. - -#### Dziwactwa Androida - -Android używa intencje do rozpoczęcia działalności aparatu na urządzenie do przechwytywania obrazów, i na telefony z pamięci, Cordova aktywność może zostać zabity. W tym scenariuszu obraz mogą nie być wyświetlane po przywróceniu aktywności Cordova. - -#### Quirks przeglądarki - -Może zwracać tylko zdjęcia jako obraz w formacie algorytmem base64. - -#### Firefox OS dziwactwa - -Aparat plugin jest obecnie implementowane za pomocą [Działania sieci Web](https://hacks.mozilla.org/2013/01/introducing-web-activities/). - -#### Dziwactwa iOS - -W jednej z funkcji wywołania zwrotnego w tym JavaScript `alert()` może powodować problemy. Owinąć w `setTimeout()` umożliwia wybór obrazu iOS lub popover całkowicie zamknąć zanim wyświetli alert alert: - - setTimeout(function() { - // do your thing here! - }, 0); - - -#### Dziwactwa Windows Phone 7 - -Wywoływanie aparat native aplikacji, podczas gdy urządzenie jest podłączone przez Zune nie działa i powoduje błąd wywołania zwrotnego. - -#### Dziwactwa Tizen - -Tizen obsługuje tylko `destinationType` z `Camera.DestinationType.FILE_URI` i `sourceType` z `Camera.PictureSourceType.PHOTOLIBRARY`. - -## CameraOptions - -Opcjonalne parametry, aby dostosować ustawienia aparatu. - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - - * **quality**: Jakość zapisywanego obrazu, wyrażona w przedziale 0-100, gdzie 100 zazwyczaj jest maksymalną rozdzielczością bez strat w czasie kompresji pliku. Wartością domyślną jest 50. *(Liczba)* (Pamiętaj, że informacja o rozdzielczości aparatu jest niedostępna.) - - * **destinationType**: Wybierz format zwracanej wartości. Wartością domyślną jest FILE_URI. Zdefiniowane w `navigator.camera.DestinationType` *(numer)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - - * **sourceType**: Ustaw źródło obrazu. Wartością domyślną jest aparat fotograficzny. Zdefiniowane w `navigator.camera.PictureSourceType` *(numer)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - - * **allowEdit**: Pozwala na prostą edycję obrazu przed zaznaczeniem. *(Boolean)* - - * **encodingType**: Wybierz plik obrazu zwracany jest kodowanie. Domyślnie jest JPEG. Zdefiniowane w `navigator.camera.EncodingType` *(numer)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - - * **targetWidth**: Szerokość w pikselach skalowanego obrazu. Musi być użyte z **targetHeight**. Współczynnik proporcji pozostaje stały. *(Liczba)* - - * **targetHeight**: Wysokość w pikselach skalowanego obrazu. Musi być użyte z **targetWidth**. Współczynnik proporcji pozostaje stały. *(Liczba)* - - * **mediaType**: Ustawia typ nośnika, z którego będzie wybrany. Działa tylko wtedy, gdy `PictureSourceType` jest `PHOTOLIBRARY` lub `SAVEDPHOTOALBUM`. Zdefiniowane w `nagivator.camera.MediaType` *(Liczba)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - - * **correctOrientation**: Obraca obraz aby skorygować orientację urządzenia podczas przechwytywania. *(Boolean)* - - * **saveToPhotoAlbum**: Po przechwyceniu zapisuje na urządzeniu obraz w albumie na zdjęcia. *(Boolean)* - - * **popoverOptions**: Opcja tylko dla platformy iOS, która określa położenie wyskakującego okna na iPadzie. Zdefiniowane w `CameraPopoverOptions`. - - * **cameraDirection**: Wybierz aparat do korzystania (lub z powrotem przodem). Wartością domyślną jest z powrotem. Zdefiniowane w `navigator.camera.Direction` *(numer)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -#### Amazon ogień OS dziwactwa - - * Jakakolwiek wartość w `cameraDirection` skutkuje użyciem tylnej kamery. - - * Parametr `allowEdit` jest ignorowany. - - * Oba parametry `Camera.PictureSourceType.PHOTOLIBRARY` oraz `Camera.PictureSourceType.SAVEDPHOTOALBUM` wyświetlają ten sam album ze zdjęciami. - -#### Dziwactwa Androida - - * Jakakolwiek wartość w `cameraDirection` skutkuje użyciem tylnej kamery. - - * Android również używa aktywność upraw dla allowEdit, choć upraw powinien pracować i faktycznie przejść przycięte zdjęcie Wróć do Cordova, ten tylko jeden który działa konsekwentnie jest ten, wiązany z aplikacji Google Plus zdjęcia. Inne rośliny mogą nie działać. - - * Oba parametry `Camera.PictureSourceType.PHOTOLIBRARY` oraz `Camera.PictureSourceType.SAVEDPHOTOALBUM` wyświetlają ten sam album ze zdjęciami. - -#### Jeżyna 10 dziwactwa - - * Parametr `quality` jest ignorowany. - - * Parametr `allowEdit` jest ignorowany. - - * Nie jest wspierane `Camera.MediaType`. - - * Parametr `correctOrientation` jest ignorowany. - - * Parametr `cameraDirection` jest ignorowany. - -#### Firefox OS dziwactwa - - * Parametr `quality` jest ignorowany. - - * `Camera.DestinationType`jest ignorowane i jest równa `1` (plik obrazu URI) - - * Parametr `allowEdit` jest ignorowany. - - * Ignoruje `PictureSourceType` parametr (użytkownik wybiera go w oknie dialogowym) - - * Ignoruje`encodingType` - - * Ignoruje `targetWidth` i`targetHeight` - - * Nie jest wspierane `Camera.MediaType`. - - * Parametr `correctOrientation` jest ignorowany. - - * Parametr `cameraDirection` jest ignorowany. - -#### Dziwactwa iOS - - * Ustaw `quality` poniżej 50 aby uniknąć błędów pamięci na niektórych urządzeniach. - - * Podczas korzystania z `destinationType.FILE_URI` , zdjęcia są zapisywane w katalogu tymczasowego stosowania. Zawartość katalogu tymczasowego stosowania jest usuwany po zakończeniu aplikacji. - -#### Dziwactwa Tizen - - * opcje nie są obsługiwane - - * zawsze zwraca FILE URI - -#### Windows Phone 7 i 8 dziwactwa - - * Parametr `allowEdit` jest ignorowany. - - * Parametr `correctOrientation` jest ignorowany. - - * Parametr `cameraDirection` jest ignorowany. - - * Ignoruje `saveToPhotoAlbum` parametr. Ważne: Wszystkie zdjęcia zrobione aparatem wp7/8 cordova API są zawsze kopiowane do telefonu w kamerze. W zależności od ustawień użytkownika może to też oznaczać że obraz jest automatycznie przesłane do ich OneDrive. Potencjalnie może to oznaczać, że obraz jest dostępne dla szerszego grona odbiorców niż Twoja aplikacja przeznaczona. Jeśli ten bloker aplikacji, trzeba będzie wdrożenie CameraCaptureTask, opisane na msdn: można także komentarz lub górę głosowanie powiązanych kwestii w [śledzenia błędów](https://issues.apache.org/jira/browse/CB-2083) - - * Ignoruje `mediaType` Właściwość `cameraOptions` jako SDK Windows Phone nie umożliwiają wybór filmów z PHOTOLIBRARY. - -## CameraError - -funkcja wywołania zwrotnego PrzyBłędzie, która zawiera komunikat o błędzie. - - function(message) { - // Show a helpful message - } - - -#### Opis - - * **message**: Natywny kod komunikatu zapewniany przez urządzenie. *(Ciąg znaków)* - -## cameraSuccess - -onSuccess funkcji wywołania zwrotnego, który dostarcza dane obrazu. - - function(imageData) { - // Do something with the image - } - - -#### Opis - - * **imageData**: Dane obrazu kodowane przy pomocy Base64 *lub* URI pliku obrazu, w zależności od użycia `cameraOptions`. *(Ciąg znaków)* - -#### Przykład - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -Uchwyt do okna dialogowego popover, stworzony przez `navigator.camera.getPicture`. - -#### Opis - - * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position. - -#### Obsługiwane platformy - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### Przykład - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -tylko do iOS parametrami, które określić kotwicy element lokalizacji i strzałka kierunku popover, przy wyborze zdjęć z iPad biblioteki lub album. - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -#### Opis - - * **x**: współrzędna piksela x elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)* - - * **y**: współrzędna piksela y elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)* - - * **width**: szerokość w pikselach elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)* - - * **height**: wysokość w pikselach elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)* - - * **arrowDir**: Kierunek, który powinna wskazywać strzałka na wyskakującym oknie. Zdefiniowane w `Camera.PopoverArrowDirection` *(Liczba)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -Należy pamiętać, że rozmiar popover może zmienić aby zmienić kierunek strzałki i orientacji ekranu. Upewnij się uwzględnić zmiany orientacji podczas określania położenia elementu kotwicy. - -## navigator.camera.cleanup - -Usuwa pośrednie zdjęcia zrobione przez aparat z czasowego składowania. - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -#### Opis - -Usuwa pliki obrazów pośrednich, które są przechowywane w pamięci tymczasowej po wywołaniu `camera.getPicture`. Ma zastosowanie tylko, gdy wartość `Camera.sourceType` jest równa `Camera.PictureSourceType.CAMERA` i `Camera.destinationType` jest równa `Camera.DestinationType.FILE_URI`. - -#### Obsługiwane platformy - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### Przykład - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } \ No newline at end of file diff --git a/doc/pl/index.md b/doc/pl/index.md deleted file mode 100644 index f22669876..000000000 --- a/doc/pl/index.md +++ /dev/null @@ -1,434 +0,0 @@ - - -# cordova-plugin-camera - -Ten plugin definiuje obiekt globalny `navigator.camera`, który dostarcza API do robienia zdjęć i wybór zdjęć z biblioteki obrazów systemu. - -Mimo, że obiekt jest dołączony do globalnego zakresu `navigator`, to nie dostępne dopiero po zdarzeniu `deviceready`. - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log(navigator.camera); - } - - -## Instalacja - - cordova plugin add cordova-plugin-camera - - -## navigator.camera.getPicture - -Ma zdjęcia za pomocą aparatu, lub pobiera zdjęcia z urządzenia Galeria zdjęć. Obraz jest przekazywany do wywołania zwrotnego sukces jako kodowane algorytmem base64 `ciąg`, lub identyfikator URI dla pliku obrazu. Sama metoda zwraca obiekt `CameraPopoverHandle`, który może służyć do zmiany położenia pliku wyboru popover. - - navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions ); - - -### Opis - -Funkcja `camera.getPicture` otwiera urządzenia domyślnej aplikacji aparat fotograficzny ów pozwala użytkownik wobec chwycić zębami kino. To zachowanie występuje domyślnie, gdy `Camera.sourceType` jest równa `Camera.PictureSourceType.CAMERA`. Gdy użytkownik zaskoczy zdjęcie, ten aparat fotograficzny applicationâ zamyka i aplikacji jest przywracany. - -Jeśli `Camera.sourceType` jest równe `Camera.PictureSourceType.PHOTOLIBRARY` lub `Camera.PictureSourceType.SAVEDPHOTOALBUM`, wtedy zostanie wyświetlone okno dialogowe pozwalające użytkownikowi na wybór istniejącego obrazu. Funkcja `camera.getPicture` zwraca obiekt `CameraPopoverHandle`, który obsługuje zmianę położenia okna wyboru obrazu, np. po zmianie orientacji urządzenia. - -Zwracana wartość jest wysyłany do funkcji wywołania zwrotnego `cameraSuccess`, w jednym z następujących formatów, w zależności od określonego `cameraOptions`: - -* `String` zawierający obraz zakodowany przy pomocy base64. - -* `String` reprezentujący lokalizację pliku obrazu w lokalnym magazynie (domyślnie). - -Może rób, co chcesz z zakodowany obraz lub identyfikatora URI, na przykład: - -* Przedstawić obraz w tagu ``, jak w przykładzie poniżej - -* Zapisać lokalnie dane (`LocalStorage`, [Lawnchair][1], etc.) - -* Wysłać dane na zdalny serwer - - [1]: http://brianleroux.github.com/lawnchair/ - -**Uwaga**: zdjęcie rozdzielczości na nowsze urządzenia jest bardzo dobry. Zdjęcia wybrane z galerii urządzenia są nie przeskalowanych w dół do niższej jakości, nawet jeśli określono parametr `quality`. Aby uniknąć typowych problemów z pamięci, zestaw `Camera.destinationType` `FILE_URI` zamiast `DATA_URL`. - -### Obsługiwane platformy - -* Amazon Fire OS -* Android -* BlackBerry 10 -* Przeglądarka -* Firefox OS -* iOS -* Tizen -* Windows Phone 7 i 8 -* Windows 8 - -### Preferencje (iOS) - -* **CameraUsesGeolocation** (boolean, wartość domyślna to false). Do przechwytywania JPEG, zestaw do true, aby uzyskać danych geolokalizacyjnych w nagłówku EXIF. To spowoduje wniosek o geolokalizacji uprawnienia, jeśli zestaw na wartość true. - - - - -### Amazon ogień OS dziwactwa - -Amazon ogień OS używa intencje do rozpoczęcia działalności aparatu na urządzenie do przechwytywania obrazów, i na telefony z pamięci, Cordova aktywność może zostać zabity. W tym scenariuszu obraz mogą nie być wyświetlane po przywróceniu aktywności cordova. - -### Dziwactwa Androida - -Android używa intencje do rozpoczęcia działalności aparatu na urządzenie do przechwytywania obrazów, i na telefony z pamięci, Cordova aktywność może zostać zabity. W tym scenariuszu obraz mogą nie być wyświetlane po przywróceniu aktywności Cordova. - -### Quirks przeglądarki - -Może zwracać tylko zdjęcia jako obraz w formacie algorytmem base64. - -### Firefox OS dziwactwa - -Aparat plugin jest obecnie implementowane za pomocą [Działania sieci Web][2]. - - [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ - -### Dziwactwa iOS - -W jednej z funkcji wywołania zwrotnego w tym JavaScript `alert()` może powodować problemy. Owinąć w `setTimeout()` umożliwia wybór obrazu iOS lub popover całkowicie zamknąć zanim wyświetli alert alert: - - setTimeout(function() { - // do your thing here! - }, 0); - - -### Dziwactwa Windows Phone 7 - -Wywoływanie aparat native aplikacji, podczas gdy urządzenie jest podłączone przez Zune nie działa i powoduje błąd wywołania zwrotnego. - -### Dziwactwa Tizen - -Tizen obsługuje tylko `destinationType` z `Camera.DestinationType.FILE_URI` i `sourceType` z `Camera.PictureSourceType.PHOTOLIBRARY`. - -### Przykład - -Zrób zdjęcie i pobrać go jako kodowane algorytmem base64 obrazu: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -Zrób zdjęcie i pobrać lokalizacji pliku obrazu: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -## CameraOptions - -Opcjonalne parametry, aby dostosować ustawienia aparatu. - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - -### Opcje - -* **quality**: Jakość zapisywanego obrazu, wyrażona w przedziale 0-100, gdzie 100 zazwyczaj jest maksymalną rozdzielczością bez strat w czasie kompresji pliku. Wartością domyślną jest 50. *(Liczba)* (Pamiętaj, że informacja o rozdzielczości aparatu jest niedostępna.) - -* **destinationType**: Wybierz format zwracanej wartości. Wartością domyślną jest FILE_URI. Zdefiniowane w `navigator.camera.DestinationType` *(numer)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - -* **sourceType**: Ustaw źródło obrazu. Wartością domyślną jest aparat fotograficzny. Zdefiniowane w `navigator.camera.PictureSourceType` *(numer)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - -* **allowEdit**: Pozwala na prostą edycję obrazu przed zaznaczeniem. *(Boolean)* - -* **encodingType**: Wybierz plik obrazu zwracany jest kodowanie. Domyślnie jest JPEG. Zdefiniowane w `navigator.camera.EncodingType` *(numer)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - -* **targetWidth**: Szerokość w pikselach skalowanego obrazu. Musi być użyte z **targetHeight**. Współczynnik proporcji pozostaje stały. *(Liczba)* - -* **targetHeight**: Wysokość w pikselach skalowanego obrazu. Musi być użyte z **targetWidth**. Współczynnik proporcji pozostaje stały. *(Liczba)* - -* **mediaType**: Ustawia typ nośnika, z którego będzie wybrany. Działa tylko wtedy, gdy `PictureSourceType` jest `PHOTOLIBRARY` lub `SAVEDPHOTOALBUM`. Zdefiniowane w `nagivator.camera.MediaType` *(Liczba)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - -* **correctOrientation**: Obraca obraz aby skorygować orientację urządzenia podczas przechwytywania. *(Boolean)* - -* **saveToPhotoAlbum**: Po przechwyceniu zapisuje na urządzeniu obraz w albumie na zdjęcia. *(Boolean)* - -* **popoverOptions**: Opcja tylko dla platformy iOS, która określa położenie wyskakującego okna na iPadzie. Zdefiniowane w `CameraPopoverOptions`. - -* **cameraDirection**: Wybierz aparat do korzystania (lub z powrotem przodem). Wartością domyślną jest z powrotem. Zdefiniowane w `navigator.camera.Direction` *(numer)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -### Amazon ogień OS dziwactwa - -* Jakakolwiek wartość w `cameraDirection` skutkuje użyciem tylnej kamery. - -* Parametr `allowEdit` jest ignorowany. - -* Oba parametry `Camera.PictureSourceType.PHOTOLIBRARY` oraz `Camera.PictureSourceType.SAVEDPHOTOALBUM` wyświetlają ten sam album ze zdjęciami. - -### Dziwactwa Androida - -* Jakakolwiek wartość w `cameraDirection` skutkuje użyciem tylnej kamery. - -* Parametr `allowEdit` jest ignorowany. - -* Oba parametry `Camera.PictureSourceType.PHOTOLIBRARY` oraz `Camera.PictureSourceType.SAVEDPHOTOALBUM` wyświetlają ten sam album ze zdjęciami. - -### Jeżyna 10 dziwactwa - -* Parametr `quality` jest ignorowany. - -* Parametr `allowEdit` jest ignorowany. - -* Nie jest wspierane `Camera.MediaType`. - -* Parametr `correctOrientation` jest ignorowany. - -* Parametr `cameraDirection` jest ignorowany. - -### Firefox OS dziwactwa - -* Parametr `quality` jest ignorowany. - -* `Camera.DestinationType`jest ignorowane i jest równa `1` (plik obrazu URI) - -* Parametr `allowEdit` jest ignorowany. - -* Ignoruje `PictureSourceType` parametr (użytkownik wybiera go w oknie dialogowym) - -* Ignoruje`encodingType` - -* Ignoruje `targetWidth` i`targetHeight` - -* Nie jest wspierane `Camera.MediaType`. - -* Parametr `correctOrientation` jest ignorowany. - -* Parametr `cameraDirection` jest ignorowany. - -### Dziwactwa iOS - -* Ustaw `quality` poniżej 50 aby uniknąć błędów pamięci na niektórych urządzeniach. - -* Podczas korzystania z `destinationType.FILE_URI` , zdjęcia są zapisywane w katalogu tymczasowego stosowania. Zawartość katalogu tymczasowego stosowania jest usuwany po zakończeniu aplikacji. - -### Dziwactwa Tizen - -* opcje nie są obsługiwane - -* zawsze zwraca FILE URI - -### Windows Phone 7 i 8 dziwactwa - -* Parametr `allowEdit` jest ignorowany. - -* Parametr `correctOrientation` jest ignorowany. - -* Parametr `cameraDirection` jest ignorowany. - -* Ignoruje `saveToPhotoAlbum` parametr. Ważne: Wszystkie zdjęcia zrobione aparatem wp7/8 cordova API są zawsze kopiowane do telefonu w kamerze. W zależności od ustawień użytkownika może to też oznaczać że obraz jest automatycznie przesłane do ich OneDrive. Potencjalnie może to oznaczać, że obraz jest dostępne dla szerszego grona odbiorców niż Twoja aplikacja przeznaczona. Jeśli ten bloker aplikacji, trzeba będzie wdrożenie CameraCaptureTask, opisane na msdn: można także komentarz lub górę głosowanie powiązanych kwestii w [śledzenia błędów][3] - -* Ignoruje `mediaType` Właściwość `cameraOptions` jako SDK Windows Phone nie umożliwiają wybór filmów z PHOTOLIBRARY. - - [3]: https://issues.apache.org/jira/browse/CB-2083 - -## CameraError - -funkcja wywołania zwrotnego PrzyBłędzie, która zawiera komunikat o błędzie. - - function(message) { - // Show a helpful message - } - - -### Parametry - -* **message**: Natywny kod komunikatu zapewniany przez urządzenie. *(Ciąg znaków)* - -## cameraSuccess - -onSuccess funkcji wywołania zwrotnego, który dostarcza dane obrazu. - - function(imageData) { - // Do something with the image - } - - -### Parametry - -* **imageData**: Dane obrazu kodowane przy pomocy Base64 *lub* URI pliku obrazu, w zależności od użycia `cameraOptions`. *(Ciąg znaków)* - -### Przykład - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -Uchwyt do okna dialogowego popover, stworzony przez `navigator.camera.getPicture`. - -### Metody - -* **setPosition**: Ustawia pozycję wyskakującego okna. - -### Obsługiwane platformy - -* iOS - -### setPosition - -Ustaw pozycję popover. - -**Parametry**: - -* `cameraPopoverOptions`: `CameraPopoverOptions`, która określa nową pozycję - -### Przykład - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -tylko do iOS parametrami, które określić kotwicy element lokalizacji i strzałka kierunku popover, przy wyborze zdjęć z iPad biblioteki lub album. - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -### CameraPopoverOptions - -* **x**: współrzędna piksela x elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)* - -* **y**: współrzędna piksela y elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)* - -* **width**: szerokość w pikselach elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)* - -* **height**: wysokość w pikselach elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)* - -* **arrowDir**: Kierunek, który powinna wskazywać strzałka na wyskakującym oknie. Zdefiniowane w `Camera.PopoverArrowDirection` *(Liczba)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -Należy pamiętać, że rozmiar popover może zmienić aby zmienić kierunek strzałki i orientacji ekranu. Upewnij się uwzględnić zmiany orientacji podczas określania położenia elementu kotwicy. - -## navigator.camera.cleanup - -Usuwa pośrednie zdjęcia zrobione przez aparat z czasowego składowania. - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -### Opis - -Usuwa pliki obrazów pośrednich, które są przechowywane w pamięci tymczasowej po wywołaniu `camera.getPicture`. Ma zastosowanie tylko, gdy wartość `Camera.sourceType` jest równa `Camera.PictureSourceType.CAMERA` i `Camera.destinationType` jest równa `Camera.DestinationType.FILE_URI`. - -### Obsługiwane platformy - -* iOS - -### Przykład - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } diff --git a/doc/ru/index.md b/doc/ru/index.md deleted file mode 100644 index f93609ca0..000000000 --- a/doc/ru/index.md +++ /dev/null @@ -1,417 +0,0 @@ - - -# cordova-plugin-camera - -Этот плагин предоставляет API для съемки и для выбора изображения из библиотеки изображений системы. - - cordova plugin add cordova-plugin-camera - - -## navigator.camera.getPicture - -Снимает фотографию с помощью камеры, или получает фотографию из галереи изображений устройства. Изображение передается на функцию обратного вызова успешного завершения как `String` в base64-кодировке, или как URI указывающего на файл изображения. Метод возвращает объект `CameraPopoverHandle`, который может использоваться для перемещения инструмента выбора файла. - - navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions ); - - -### Описание - -Функция `camera.getPicture` открывает приложение камеры устройства, которое позволяет снимать фотографии. Это происходит по умолчанию, когда `Camera.sourceType` равно `Camera.PictureSourceType.CAMERA` . Как только пользователь делает снимок,приложение камеры закрывается и приложение восстанавливается. - -Если `Camera.sourceType` является `Camera.PictureSourceType.PHOTOLIBRARY` или `Camera.PictureSourceType.SAVEDPHOTOALBUM` , то показывается диалоговое окно, которое позволяет пользователям выбрать существующее изображение. Функция `camera.getPicture` возвращает объект `CameraPopoverHandle` объект, который может использоваться для перемещения диалога выбора изображения, например, при изменении ориентации устройства. - -Возвращаемое значение отправляется в функцию обратного вызова `cameraSuccess` в одном из следующих форматов, в зависимости от параметра `cameraOptions` : - -* A объект `String` содержащий фото изображение в base64-кодировке. - -* Объект `String` представляющий расположение файла изображения на локальном хранилище (по умолчанию). - -Вы можете сделать все, что угодно вы хотите с закодированным изображением или URI, например: - -* Отобразить изображение с помощью тега ``, как показано в примере ниже - -* Сохранять данные локально (`LocalStorage`, [Lawnchair][1], и т.д.) - -* Отправлять данные на удаленный сервер - - [1]: http://brianleroux.github.com/lawnchair/ - -**Примечание**: разрешение фото на более новых устройствах является достаточно хорошим. Фотографии из галереи устройства не масштабируются к более низкому качеству, даже если указан параметр `quality`. Чтобы избежать общих проблем с памятью, установите `Camera.destinationType` в `FILE_URI` вместо `DATA_URL`. - -### Поддерживаемые платформы - -* Amazon Fire OS -* Android -* BlackBerry 10 -* Обозреватель -* Firefox OS -* iOS -* Tizen -* Windows Phone 7 и 8 -* Windows 8 - -### Предпочтения (iOS) - -* **CameraUsesGeolocation** (логическое значение, по умолчанию false). Для захвата изображения JPEG, значение true, чтобы получить данные геопозиционирования в заголовке EXIF. Это вызовет запрос на разрешения геолокации, если задано значение true. - - - - -### Особенности Amazon Fire OS - -Amazon Fire OS используют намерения для запуска активности камеры на устройстве для съемки фотографий, и на устройствах с низким объемам памяти, активность Cordova может быть завершена. В этом случае изображение может не появиться при восстановлении активности Cordova. - -### Особенности Android - -Android используют намерения для запуска активности камеры на устройстве для съемки фотографий, и на устройствах с низким объемам памяти, активность Cordova может быть завершена. В этом случае изображение может не появиться при восстановлении активности Cordova. - -### Браузер причуды - -Может возвращать только фотографии как изображения в кодировке base64. - -### Особенности Firefox OS - -Плагин Camera на данный момент реализован с использованием [Web Activities][2]. - - [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ - -### Особенности iOS - -Включение функции JavaScript `alert()` в любой из функций обратного вызова функции может вызвать проблемы. Оберните вызов alert в `setTimeout()` для позволения окну выбора изображений iOS полностью закрыться перед отображение оповещения: - - setTimeout(function() {/ / ваши вещи!}, 0); - - -### Особенности Windows Phone 7 - -Вызов встроенного приложения камеры, в то время как устройство подключено к Zune не работает, и инициирует обратный вызов для ошибки. - -### Особенности Tizen - -Tizen поддерживает только значение `destinationType` равное `Camera.DestinationType.FILE_URI` и значение `sourceType` равное `Camera.PictureSourceType.PHOTOLIBRARY`. - -### Пример - -Сделайте фотографию и получите его как изображение в base64-кодировке: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -Сделайте фотографию и получить расположение файла с изображением: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -## CameraOptions - -Необязательные параметры для настройки параметров камеры. - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - -### Параметры - -* **quality**: качество сохраняемого изображения, выражается в виде числа в диапазоне от 0 до 100, где 100 является обычно полным изображением без потери качества при сжатии. Значение по умолчанию — 50. *(Число)* (Обратите внимание, что информация о разрешении камеры недоступна.) - -* **параметр destinationType**: выберите формат возвращаемого значения. Значение по умолчанию — FILE_URI. Определяется в `navigator.camera.DestinationType` *(число)* - - Camera.DestinationType = { - DATA_URL: 0, / / возвращение изображения в base64-кодировке строки - FILE_URI: 1, / / возврат файла изображения URI - NATIVE_URI: 2 / / возвращение образа собственного URI (например, Библиотека активов: / / на iOS или содержание: / / на андроиде) - }; - - -* **тип источника**: установить источник рисунка. По умолчанию используется камера. Определяется в `navigator.camera.PictureSourceType` *(число)* - - Camera.PictureSourceType = { - PHOTOLIBRARY: 0, - CAMERA: 1, - SAVEDPHOTOALBUM: 2 - }; - - -* **allowEdit**: позволит редактирование изображения средствами телефона перед окончательным выбором изображения. *(Логический)* - -* **Тип_шифрования**: выберите возвращенный файл в кодировку. Значение по умолчанию — JPEG. Определяется в `navigator.camera.EncodingType` *(число)* - - Camera.EncodingType = { - JPEG: 0, // возвращает изображение в формате JPEG - PNG: 1 // возвращает рисунок в формате PNG - }; - - -* **targetWidth**: ширина изображения в пикселах к которой необходимо осуществить масштабирование. Это значение должно использоваться совместно с **targetHeight**. Пропорции изображения останутся неизменными. *(Число)* - -* **targetHeight**: высота изображения в пикселах к которой необходимо осуществить масштабирование. Это значение должно использоваться совместно с **targetWidth**. Пропорции изображения останутся неизменными. *(Число)* - -* **тип носителя**: Установите источник получения изображения, из которого надо выбрать изображение. Работает только если `PictureSourceType` равно `PHOTOLIBRARY` или `SAVEDPHOTOALBUM` . Определяется в `nagivator.camera.MediaType` *(число)* - - Camera.MediaType = { - PICTURE: 0, / / разрешить выбор только сохраненных изображений. DEFAULT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - -* **correctOrientation**: вращает изображение, чтобы внести исправления к ориентации устройства во время захвата. *(Логический)* - -* **saveToPhotoAlbum**: сохранить изображение в фотоальбом на устройстве после захвата. *(Логическое)* - -* **popoverOptions**: только для iOS параметры, которые определяют местоположение инструмента в iPad. Определены в`CameraPopoverOptions`. - -* **cameraDirection**: выбрать камеру для использования (передней или задней стороне). Значение по умолчанию — обратно. Определяется в `navigator.camera.Direction` *(число)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -### Особенности Amazon Fire OS - -* Любое значение `cameraDirection` возвращает фотографию сделанную задней камерой. - -* Игнорирует параметр `allowEdit`. - -* Оба параметра `Camera.PictureSourceType.PHOTOLIBRARY` и `Camera.PictureSourceType.SAVEDPHOTOALBUM` отображают один и тот же фотоальбом. - -### Особенности Android - -* Любое значение `cameraDirection` возвращает фотографию сделанную задней камерой. - -* Игнорирует параметр `allowEdit`. - -* Оба параметра `Camera.PictureSourceType.PHOTOLIBRARY` и `Camera.PictureSourceType.SAVEDPHOTOALBUM` отображают один и тот же фотоальбом. - -### Особенности BlackBerry 10 - -* Игнорирует `quality` параметр. - -* Игнорирует параметр `allowEdit`. - -* `Camera.MediaType` не поддерживается. - -* Игнорирует параметр `correctOrientation`. - -* Игнорирует параметр `cameraDirection`. - -### Особенности Firefox OS - -* Игнорирует `quality` параметр. - -* Значение `Camera.DestinationType` игнорируется и равно `1` (URI для файла изображения) - -* Игнорирует параметр `allowEdit`. - -* Игнорирует параметр `PictureSourceType` (пользователь выбирает его в диалоговом окне) - -* Игнорирует параметр `encodingType` - -* Игнорирует `targetWidth` и `targetHeight` - -* `Camera.MediaType` не поддерживается. - -* Игнорирует параметр `correctOrientation`. - -* Игнорирует параметр `cameraDirection`. - -### Особенности iOS - -* Установите `quality` ниже 50, для того чтобы избежать ошибок памяти на некоторых устройствах. - -* При использовании `destinationType.FILE_URI` , фотографии сохраняются во временном каталоге приложения. Содержимое приложения временного каталога удаляется при завершении приложения. - -### Особенности Tizen - -* options, не поддерживается - -* всегда возвращает URI файла - -### Особенности Windows Phone 7 и 8 - -* Игнорирует параметр `allowEdit`. - -* Игнорирует параметр `correctOrientation`. - -* Игнорирует параметр `cameraDirection`. - -* Игнорирует `saveToPhotoAlbum` параметр. Важно: Все изображения, снятые камерой wp7/8 cordova API всегда копируются в рулон камеры телефона. В зависимости от параметров пользователя это также может означать, что изображение автоматически загружены на их OneDrive. Потенциально это может означать, что этот образ доступен для более широкой аудитории, чем ваше приложение предназначено. Если этот блокатор для вашего приложения, вам нужно будет осуществить CameraCaptureTask, как описано на сайте msdn: вы можете также комментарий или вверх голосование связанный с этим вопрос [отслеживания][3] - -* Игнорирует свойство `mediaType` объекта `cameraOptions` так как Windows Phone SDK не предоставляет способ выбрать видео из PHOTOLIBRARY. - - [3]: https://issues.apache.org/jira/browse/CB-2083 - -## CameraError - -Функция обратного вызова вызываемая в случае возникновения ошибки. - - function(message) { - // Show a helpful message - } - - -### Параметры - -* **сообщение**: сообщение об ошибке предоставляемое платформой устройства. *(Строка)* - -## cameraSuccess - -Функция обратного вызова onSuccess, получающая данные изображения. - - function(imageData) { - // Do something with the image - } - - -### Параметры - -* **imageData**: Данные изображения в Base64 кодировке, *или* URI, в зависимости от применяемых параметров `cameraOptions`. *(Строка)* - -### Пример - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -Дескриптор диалогового окна инструмента, созданный `navigator.camera.getPicture`. - -### Методы - -* **setPosition**: Задайте положение инструмента выбора изображения. - -### Поддерживаемые платформы - -* iOS - -### setPosition - -Устанавливает положение инструмента выбора изображения. - -**Параметры**: - -* `cameraPopoverOptions`: Объект `CameraPopoverOptions`, определяющий новое положение - -### Пример - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -Параметры только для iOS, которые определяют расположение элемента привязки и направление стрелки инструмента при выборе изображений из библиотеки изображений iPad или альбома. - - {x: 0, y: 32, ширина: 320, высота: 480, arrowDir: Camera.PopoverArrowDirection.ARROW_ANY}; - - -### CameraPopoverOptions - -* **x**: x координата в пикселях элемента экрана, на котором закрепить инструмента. *(Число)* - -* **x**: y координата в пикселях элемента экрана, на котором закрепить инструмента. *(Число)* - -* **width**: ширина в пикселях элемента экрана, на котором закрепить инструмент выбора изображения. *(Число)* - -* **height**: высота в пикселях элемента экрана, на котором закрепить инструмент выбора изображения. *(Число)* - -* **arrowDir**: Направление, куда должна указывать стрелка на инструменте. Определено в `Camera.PopoverArrowDirection` *(число)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -Обратите внимание, что размер инструмента может изменяться для корректировки в зависимости направлении стрелки и ориентации экрана. Убедитесь, что учитываете возможные изменения ориентации при указании расположения элемента привязки. - -## navigator.camera.cleanup - -Удаляет промежуточные фотографии, сделанные камерой из временного хранилища. - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -### Описание - -Удаляет промежуточные файлы изображений, которые хранятся во временном хранилище после вызова метода `camera.getPicture` . Применяется только тогда, когда значение `Camera.sourceType` равно `Camera.PictureSourceType.CAMERA` и `Camera.destinationType` равняется `Camera.DestinationType.FILE_URI`. - -### Поддерживаемые платформы - -* iOS - -### Пример - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } diff --git a/doc/zh/README.md b/doc/zh/README.md deleted file mode 100644 index 2f7c9e658..000000000 --- a/doc/zh/README.md +++ /dev/null @@ -1,421 +0,0 @@ - - -# cordova-plugin-camera - -[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera) - -這個外掛程式定義了一個全球 `navigator.camera` 物件,它提供了 API,拍照,從系統的圖像庫中選擇圖像。 - -雖然該物件附加到全球範圍內 `導航器`,它不可用直到 `deviceready` 事件之後。 - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log(navigator.camera); - } - - -## 安裝 - - cordova plugin add cordova-plugin-camera - - -## API - - * 相機 - * navigator.camera.getPicture(success, fail, options) - * CameraOptions - * CameraPopoverHandle - * CameraPopoverOptions - * navigator.camera.cleanup - -## navigator.camera.getPicture - -需要一張照片,使用相機,或從設備的圖像庫檢索一張照片。 圖像被傳遞給成功回檔的 base64 編碼 `String`,或作為 URI 為影像檔。 該方法本身返回一個 `CameraPopoverHandle` 物件,它可以用來重新置放檔選擇氣泡框。 - - navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions); - - -#### 說明 - -`camera.getPicture` 函數打開該設備的預設攝像頭應用程式,允許使用者拍照。 `Camera.sourceType` 等於 `Camera.PictureSourceType.CAMERA` 時,預設情況下,發生此行為。 一旦使用者打斷了他的照片,相機應用程式關閉,且應用程式還原。 - -如果 `Camera.sourceType` 是 `Camera.PictureSourceType.PHOTOLIBRARY` 或 `Camera.PictureSourceType.SAVEDPHOTOALBUM`,然後顯示一個對話方塊,允許使用者選擇一個現有的圖像。 `camera.getPicture` 函數返回一個 `CameraPopoverHandle` 物件,它可以用於重新置放圖像選擇的對話方塊,例如,當設備的方向變化。 - -傳回值是發送到 `cameraSuccess` 回呼函數中,在以下的格式,具體取決於指定的 `cameraOptions` 之一: - - * A `String` 包含的 base64 編碼的照片圖像。 - - * A `String` 表示在本機存放區 (預設值) 上的影像檔位置。 - -你可以做任何你想要的編碼的圖像或 URI,例如: - - * 呈現在圖像 `` 標記,如下面的示例所示 - - * 保存本地的資料 ( `LocalStorage` , [Lawnchair](http://brianleroux.github.com/lawnchair/),等等.) - - * 將資料發佈到遠端伺服器 - -**注**: 在更新設備上的照片解析度是很好。 選擇從設備的庫的照片是不壓縮螢幕使其以較低的品質,即使指定了一個 `quality` 參數。 要避免常見的記憶體問題,請將 `Camera.destinationType` 設置為 `FILE_URI`,而不是 `DATA_URL`. - -#### 支援的平臺 - -![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png) - -#### 示例 - -拍一張照片,並檢索它作為一個 base64 編碼的圖像: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -拍一張照片和檢索圖像的檔位置: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -#### 首選項 (iOS) - - * **CameraUsesGeolocation**(布林值,預設值為 false)。 用於捕獲 jpeg 檔,設置為 true,以在 EXIF 頭資訊中獲取地理定位資料。 這將觸發請求的地理位置的許可權,如果設置為 true。 - - - - -#### 亞馬遜火 OS 怪癖 - -亞馬遜火 OS 使用意圖啟動相機活動設備來捕捉圖像上, 和手機上記憶體不足,科爾多瓦活動可能被殺害。 在這種情況下,可能不會顯示圖像時恢復了科爾多瓦活動。 - -#### Android 的怪癖 - -Android 使用意圖以啟動相機活動設備來捕捉圖像上, 和手機上記憶體不足,科爾多瓦活動可能被殺害。 在這種情況下,可能不會顯示圖像時恢復了科爾多瓦活動。 - -#### 瀏覽器的怪癖 - -可以只返回照片作為 base64 編碼的圖像。 - -#### 火狐瀏覽器作業系統的怪癖 - -觀景窗外掛程式目前實施使用 [Web 活動](https://hacks.mozilla.org/2013/01/introducing-web-activities/). - -#### iOS 的怪癖 - -包括 JavaScript `alert ()` 中的回呼函數會導致問題。 包裝內 `setTimeout()` 允許 iOS 圖像選取器或氣泡框以完全關閉之前,警報將顯示警報: - - setTimeout(function() { - // do your thing here! - }, 0); - - -#### Windows Phone 7 的怪癖 - -調用本機攝像頭應用程式,而通過 Zune 所連接的設備不能工作,並且觸發錯誤回檔。 - -#### Tizen 怪癖 - -泰只支援 `destinationType` 的 `Camera.DestinationType.FILE_URI` 和 `Camera.PictureSourceType.PHOTOLIBRARY` 的 `sourceType`. - -## CameraOptions - -要自訂相機設置的可選參數。 - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - - * **品質**: 保存的圖像,表示為範圍 0-100,100,是通常全解析度,無損失從檔案壓縮的品質。 預設值為 50。 *(人數)*(請注意相機的解析度有關的資訊是不可用)。 - - * **可**: 選擇傳回值的格式。預設值是 FILE_URI。定義在 `navigator.camera.DestinationType` *(人數)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - - * **時**: 設置圖片的來源。預設值是觀景窗。定義在 `navigator.camera.PictureSourceType` *(人數)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - - * **allowEdit**: 允許簡單編輯前選擇圖像。*(布林)* - - * **encodingType**: 選擇返回的影像檔的編碼。預設值為 JPEG。定義在 `navigator.camera.EncodingType` *(人數)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - - * **targetWidth**: 向尺度圖像的圖元寬度。必須用**targetHeight**。縱橫比保持不變。*(人數)* - - * **targetHeight**: 以圖元為單位向尺度圖像的高度。必須用**targetWidth**。縱橫比保持不變。*(人數)* - - * **媒體類型**: 設置的媒體,從選擇類型。 時才起作用 `PictureSourceType` 是 `PHOTOLIBRARY` 或 `SAVEDPHOTOALBUM` 。 定義在 `nagivator.camera.MediaType` *(人數)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. 預設情況。 Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - - * **correctOrientation**: 旋轉圖像,該設備時捕獲的定向的正確。*(布林)* - - * **saveToPhotoAlbum**: 將圖像保存到相冊在設備上捕獲後。*(布林)* - - * **popoverOptions**: 只有 iOS 在 iPad 中指定氣泡框位置的選項。在中定義`CameraPopoverOptions`. - - * **cameraDirection**: 選擇相機以使用 (前面或後面-面向)。預設值是背。定義在 `navigator.camera.Direction` *(人數)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -#### 亞馬遜火 OS 怪癖 - - * 任何 `cameraDirection` 值回朝的照片中的結果。 - - * 忽略 `allowEdit` 參數。 - - * `Camera.PictureSourceType.PHOTOLIBRARY`和 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 都顯示相同的相冊。 - -#### Android 的怪癖 - - * 任何 `cameraDirection` 值回朝的照片中的結果。 - - * 安卓也用於作物活動 allowEdit,即使作物應工作,實際上將裁剪的圖像傳回給科爾多瓦,那個唯一的作品一直是一個與谷歌加上照片應用程式捆綁在一起。 其他作物可能無法工作。 - - * `Camera.PictureSourceType.PHOTOLIBRARY`和 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 都顯示相同的相冊。 - -#### 黑莓 10 怪癖 - - * 忽略 `quality` 參數。 - - * 忽略 `allowEdit` 參數。 - - * `Camera.MediaType`不受支援。 - - * 忽略 `correctOrientation` 參數。 - - * 忽略 `cameraDirection` 參數。 - -#### 火狐瀏覽器作業系統的怪癖 - - * 忽略 `quality` 參數。 - - * `Camera.DestinationType`將被忽略並且等於 `1` (影像檔的 URI) - - * 忽略 `allowEdit` 參數。 - - * 忽略 `PictureSourceType` 參數 (使用者選擇它在對話方塊視窗中) - - * 忽略`encodingType` - - * 忽略了 `targetWidth` 和`targetHeight` - - * `Camera.MediaType`不受支援。 - - * 忽略 `correctOrientation` 參數。 - - * 忽略 `cameraDirection` 參數。 - -#### iOS 的怪癖 - - * 設置 `quality` 低於 50,避免在某些設備上的記憶體不足錯誤。 - - * 當使用 `destinationType.FILE_URI` ,照片都保存在應用程式的臨時目錄。應用程式結束時,將刪除該應用程式的臨時目錄中的內容。 - -#### Tizen 怪癖 - - * 不支援的選項 - - * 總是返回一個檔的 URI - -#### Windows Phone 7 和 8 怪癖 - - * 忽略 `allowEdit` 參數。 - - * 忽略 `correctOrientation` 參數。 - - * 忽略 `cameraDirection` 參數。 - - * 忽略 `saveToPhotoAlbum` 參數。 重要: 使用 wp7/8 科爾多瓦攝像頭 API 拍攝的所有圖像總是都複製到手機的相機膠捲。 根據使用者的設置,這可能也意味著圖像是自動上傳到他們另。 這有可能意味著的圖像,可以比你的應用程式的目的更多的觀眾。 如果此阻滯劑您的應用程式,您將需要實現 CameraCaptureTask 在 msdn 上記載: [HTTP://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx](http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx)你可能還評論或在[問題追蹤器](https://issues.apache.org/jira/browse/CB-2083)的向上投票的相關的問題 - - * 忽略了 `mediaType` 屬性的 `cameraOptions` 作為 Windows Phone SDK 並不提供從 PHOTOLIBRARY 中選擇視頻的方法。 - -## CameraError - -onError 的回呼函數提供了一條錯誤訊息。 - - function(message) { - // Show a helpful message - } - - -#### 說明 - - * **message**: 消息提供的設備的本機代碼。*(String)* - -## cameraSuccess - -提供的圖像資料的 onSuccess 回呼函數。 - - function(imageData) { - // Do something with the image - } - - -#### 說明 - - * **imageData**: Base64 編碼進行編碼的圖像資料,*或*影像檔的 URI,取決於 `cameraOptions` 效果。*(String)* - -#### 示例 - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -由 `navigator.camera.getPicture` 創建的氣泡框對話方塊的控制碼. - -#### 說明 - - * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position. - -#### 支援的平臺 - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### 示例 - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -iOS 僅指定氣泡框的錨元素的位置和箭頭方向,從 iPad 庫或專輯選擇圖像時的參數。 - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -#### 說明 - - * **x**: x 螢幕元素到其錨定氣泡框上的圖元座標。*(人數)* - - * **y**: 螢幕元素到其錨定氣泡框上的 y 圖元座標。*(人數)* - - * **width**: 寬度以圖元為單位),到其錨定氣泡框上的螢幕元素。*(人數)* - - * **height**: 高度以圖元為單位),到其錨定氣泡框上的螢幕元素。*(人數)* - - * **arrowDir**: 氣泡框上的箭頭應指向的方向。定義在 `Camera.PopoverArrowDirection` *(人數)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -請注意氣泡框的大小可能會更改箭頭的方向和螢幕的方向進行調整。 請確保帳戶方向更改時指定錨元素位置。 - -## navigator.camera.cleanup - -刪除中間從臨時存儲攝像機所拍攝的照片。 - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -#### 說明 - -刪除保留在臨時存儲在調用 `camera.getPicture` 後的中間的影像檔。 適用只有當 `Camera.sourceType` 的值等於 `Camera.PictureSourceType.CAMERA` 和 `Camera.destinationType` 等於 `Camera.DestinationType.FILE_URI`. - -#### 支援的平臺 - -![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png) - -#### 示例 - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - } \ No newline at end of file diff --git a/doc/zh/index.md b/doc/zh/index.md deleted file mode 100644 index ab719ab51..000000000 --- a/doc/zh/index.md +++ /dev/null @@ -1,435 +0,0 @@ - - -# cordova-plugin-camera - -這個外掛程式定義了一個全球 `navigator.camera` 物件,它提供了 API,拍照,從系統的圖像庫中選擇圖像。 - -雖然該物件附加到全球範圍內 `導航器`,它不可用直到 `deviceready` 事件之後。 - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log(navigator.camera); - } - - -## 安裝 - - cordova plugin add cordova-plugin-camera - - -## navigator.camera.getPicture - -需要一張照片,使用相機,或從設備的圖像庫檢索一張照片。 圖像被傳遞給成功回檔的 base64 編碼 `String`,或作為 URI 為影像檔。 該方法本身返回一個 `CameraPopoverHandle` 物件,它可以用來重新置放檔選擇氣泡框。 - - navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions ); - - -### 說明 - -`camera.getPicture` 函數打開該設備的預設攝像頭應用程式,允許使用者拍照。 `Camera.sourceType` 等於 `Camera.PictureSourceType.CAMERA` 時,預設情況下,發生此行為。 一旦使用者打斷了他的照片,相機應用程式關閉,且應用程式還原。 - -如果 `Camera.sourceType` 是 `Camera.PictureSourceType.PHOTOLIBRARY` 或 `Camera.PictureSourceType.SAVEDPHOTOALBUM`,然後顯示一個對話方塊,允許使用者選擇一個現有的圖像。 `camera.getPicture` 函數返回一個 `CameraPopoverHandle` 物件,它可以用於重新置放圖像選擇的對話方塊,例如,當設備的方向變化。 - -傳回值是發送到 `cameraSuccess` 回呼函數中,在以下的格式,具體取決於指定的 `cameraOptions` 之一: - -* A `String` 包含的 base64 編碼的照片圖像。 - -* A `String` 表示在本機存放區 (預設值) 上的影像檔位置。 - -你可以做任何你想要的編碼的圖像或 URI,例如: - -* 呈現在圖像 `` 標記,如下面的示例所示 - -* 保存本地的資料 ( `LocalStorage` , [Lawnchair][1],等等.) - -* 將資料發佈到遠端伺服器 - - [1]: http://brianleroux.github.com/lawnchair/ - -**注**: 在更新設備上的照片解析度是很好。 選擇從設備的庫的照片是不壓縮螢幕使其以較低的品質,即使指定了一個 `quality` 參數。 要避免常見的記憶體問題,請將 `Camera.destinationType` 設置為 `FILE_URI`,而不是 `DATA_URL`. - -### 支援的平臺 - -* 亞馬遜火 OS -* Android 系統 -* 黑莓 10 -* 瀏覽器 -* 火狐瀏覽器的作業系統 -* iOS -* 泰 -* Windows Phone 7 和 8 -* Windows 8 - -### 首選項 (iOS) - -* **CameraUsesGeolocation**(布林值,預設值為 false)。 用於捕獲 jpeg 檔,設置為 true,以在 EXIF 頭資訊中獲取地理定位資料。 這將觸發請求的地理位置的許可權,如果設置為 true。 - - - - -### 亞馬遜火 OS 怪癖 - -亞馬遜火 OS 使用意圖啟動相機活動設備來捕捉圖像上, 和手機上記憶體不足,科爾多瓦活動可能被殺害。 在這種情況下,可能不會顯示圖像時恢復了科爾多瓦活動。 - -### Android 的怪癖 - -Android 使用意圖以啟動相機活動設備來捕捉圖像上, 和手機上記憶體不足,科爾多瓦活動可能被殺害。 在這種情況下,可能不會顯示圖像時恢復了科爾多瓦活動。 - -### 瀏覽器的怪癖 - -可以只返回照片作為 base64 編碼的圖像。 - -### 火狐瀏覽器作業系統的怪癖 - -觀景窗外掛程式目前實施使用 [Web 活動][2]. - - [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ - -### iOS 的怪癖 - -包括 JavaScript `alert ()` 中的回呼函數會導致問題。 包裝內 `setTimeout()` 允許 iOS 圖像選取器或氣泡框以完全關閉之前,警報將顯示警報: - - setTimeout(function() { - // do your thing here! - }, 0); - - -### Windows Phone 7 的怪癖 - -調用本機攝像頭應用程式,而通過 Zune 所連接的設備不能工作,並且觸發錯誤回檔。 - -### 泰怪癖 - -泰只支援 `destinationType` 的 `Camera.DestinationType.FILE_URI` 和 `Camera.PictureSourceType.PHOTOLIBRARY` 的 `sourceType`. - -### 示例 - -拍一張照片,並檢索它作為一個 base64 編碼的圖像: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.DATA_URL - }); - - function onSuccess(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -拍一張照片和檢索圖像的檔位置: - - navigator.camera.getPicture(onSuccess, onFail, { quality: 50, - destinationType: Camera.DestinationType.FILE_URI }); - - function onSuccess(imageURI) { - var image = document.getElementById('myImage'); - image.src = imageURI; - } - - function onFail(message) { - alert('Failed because: ' + message); - } - - -## CameraOptions - -要自訂相機設置的可選參數。 - - { quality : 75, - destinationType : Camera.DestinationType.DATA_URL, - sourceType : Camera.PictureSourceType.CAMERA, - allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 100, - targetHeight: 100, - popoverOptions: CameraPopoverOptions, - saveToPhotoAlbum: false }; - - -### 選項 - -* **品質**: 保存的圖像,表示為範圍 0-100,100,是通常全解析度,無損失從檔案壓縮的品質。 預設值為 50。 *(人數)*(請注意相機的解析度有關的資訊是不可用)。 - -* **可**: 選擇傳回值的格式。預設值是 FILE_URI。定義在 `navigator.camera.DestinationType` *(人數)* - - Camera.DestinationType = { - DATA_URL : 0, // Return image as base64-encoded string - FILE_URI : 1, // Return image file URI - NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) - }; - - -* **時**: 設置圖片的來源。預設值是觀景窗。定義在 `navigator.camera.PictureSourceType` *(人數)* - - Camera.PictureSourceType = { - PHOTOLIBRARY : 0, - CAMERA : 1, - SAVEDPHOTOALBUM : 2 - }; - - -* **allowEdit**: 允許簡單編輯前選擇圖像。*(布林)* - -* **encodingType**: 選擇返回的影像檔的編碼。預設值為 JPEG。定義在 `navigator.camera.EncodingType` *(人數)* - - Camera.EncodingType = { - JPEG : 0, // Return JPEG encoded image - PNG : 1 // Return PNG encoded image - }; - - -* **targetWidth**: 向尺度圖像的圖元寬度。必須用**targetHeight**。縱橫比保持不變。*(人數)* - -* **targetHeight**: 以圖元為單位向尺度圖像的高度。必須用**targetWidth**。縱橫比保持不變。*(人數)* - -* **媒體類型**: 設置的媒體,從選擇類型。 時才起作用 `PictureSourceType` 是 `PHOTOLIBRARY` 或 `SAVEDPHOTOALBUM` 。 定義在 `nagivator.camera.MediaType` *(人數)* - - Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. 預設情況。 Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI - ALLMEDIA : 2 // allow selection from all media types - }; - - -* **correctOrientation**: 旋轉圖像,該設備時捕獲的定向的正確。*(布林)* - -* **saveToPhotoAlbum**: 將圖像保存到相冊在設備上捕獲後。*(布林)* - -* **popoverOptions**: 只有 iOS 在 iPad 中指定氣泡框位置的選項。在中定義`CameraPopoverOptions`. - -* **cameraDirection**: 選擇相機以使用 (前面或後面-面向)。預設值是背。定義在 `navigator.camera.Direction` *(人數)* - - Camera.Direction = { - BACK : 0, // Use the back-facing camera - FRONT : 1 // Use the front-facing camera - }; - - -### 亞馬遜火 OS 怪癖 - -* 任何 `cameraDirection` 值回朝的照片中的結果。 - -* 忽略 `allowEdit` 參數。 - -* `Camera.PictureSourceType.PHOTOLIBRARY`和 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 都顯示相同的相冊。 - -### Android 的怪癖 - -* 任何 `cameraDirection` 值結果在背面的照片。 - -* 忽略 `allowEdit` 參數。 - -* `Camera.PictureSourceType.PHOTOLIBRARY`和 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 都顯示相同的寫真集。 - -### 黑莓 10 的怪癖 - -* 忽略 `quality` 參數。 - -* 忽略 `allowEdit` 參數。 - -* `Camera.MediaType`不受支援。 - -* 忽略 `correctOrientation` 參數。 - -* 忽略 `cameraDirection` 參數。 - -### 火狐瀏覽器作業系統的怪癖 - -* 忽略 `quality` 參數。 - -* `Camera.DestinationType`將被忽略並且等於 `1` (影像檔的 URI) - -* 忽略 `allowEdit` 參數。 - -* 忽略 `PictureSourceType` 參數 (使用者選擇它在對話方塊視窗中) - -* 忽略`encodingType` - -* 忽略了 `targetWidth` 和`targetHeight` - -* `Camera.MediaType`不受支援。 - -* 忽略 `correctOrientation` 參數。 - -* 忽略 `cameraDirection` 參數。 - -### iOS 的怪癖 - -* 設置 `quality` 低於 50,避免在某些設備上的記憶體不足錯誤。 - -* 當使用 `destinationType.FILE_URI` ,照片都保存在應用程式的臨時目錄。應用程式結束時,將刪除該應用程式的臨時目錄中的內容。 - -### 泰怪癖 - -* 不支援的選項 - -* 總是返回一個檔的 URI - -### Windows Phone 7 和 8 的怪癖 - -* 忽略 `allowEdit` 參數。 - -* 忽略 `correctOrientation` 參數。 - -* 忽略 `cameraDirection` 參數。 - -* 忽略 `saveToPhotoAlbum` 參數。 重要: 使用 wp7/8 科爾多瓦攝像頭 API 拍攝的所有圖像總是都複製到手機的相機膠捲。 根據使用者的設置,這可能也意味著圖像是自動上傳到他們另。 這有可能意味著的圖像,可以比你的應用程式的目的更多的觀眾。 如果此阻滯劑您的應用程式,您將需要實現 CameraCaptureTask 在 msdn 上記載: [HTTP://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx][3]你可能還評論或在[問題追蹤器][4]的向上投票的相關的問題 - -* 忽略了 `mediaType` 屬性的 `cameraOptions` 作為 Windows Phone SDK 並不提供從 PHOTOLIBRARY 中選擇視頻的方法。 - - [3]: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx - [4]: https://issues.apache.org/jira/browse/CB-2083 - -## CameraError - -onError 的回呼函數提供了一條錯誤訊息。 - - function(message) { - // Show a helpful message - } - - -### 參數 - -* **message**: 消息提供的設備的本機代碼。*(String)* - -## cameraSuccess - -提供的圖像資料的 onSuccess 回呼函數。 - - function(imageData) { - // Do something with the image - } - - -### 參數 - -* **imageData**: Base64 編碼進行編碼的圖像資料,*或*影像檔的 URI,取決於 `cameraOptions` 效果。*(String)* - -### 示例 - - // Show image - // - function cameraCallback(imageData) { - var image = document.getElementById('myImage'); - image.src = "data:image/jpeg;base64," + imageData; - } - - -## CameraPopoverHandle - -由 `navigator.camera.getPicture` 創建的氣泡框對話方塊的控制碼. - -### 方法 - -* **setPosition**: 設置氣泡框的位置。 - -### 支援的平臺 - -* iOS - -### setPosition - -設置氣泡框的位置。 - -**參數**: - -* `cameraPopoverOptions`: `CameraPopoverOptions` ,指定新的位置 - -### 示例 - - var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail, - { destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) - }); - - // Reposition the popover if the orientation changes. - window.onorientationchange = function() { - var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY); - cameraPopoverHandle.setPosition(cameraPopoverOptions); - } - - -## CameraPopoverOptions - -iOS 僅指定氣泡框的錨元素的位置和箭頭方向,從 iPad 庫或專輯選擇圖像時的參數。 - - { x : 0, - y : 32, - width : 320, - height : 480, - arrowDir : Camera.PopoverArrowDirection.ARROW_ANY - }; - - -### CameraPopoverOptions - -* **x**: x 螢幕元素到其錨定氣泡框上的圖元座標。*(人數)* - -* **y**: 螢幕元素到其錨定氣泡框上的 y 圖元座標。*(人數)* - -* **width**: 寬度以圖元為單位),到其錨定氣泡框上的螢幕元素。*(人數)* - -* **height**: 高度以圖元為單位),到其錨定氣泡框上的螢幕元素。*(人數)* - -* **arrowDir**: 氣泡框上的箭頭應指向的方向。定義在 `Camera.PopoverArrowDirection` *(人數)* - - Camera.PopoverArrowDirection = { - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }; - - -請注意氣泡框的大小可能會更改箭頭的方向和螢幕的方向進行調整。 請確保帳戶方向更改時指定錨元素位置。 - -## navigator.camera.cleanup - -刪除中間從臨時存儲攝像機所拍攝的照片。 - - navigator.camera.cleanup( cameraSuccess, cameraError ); - - -### 描述 - -刪除保留在臨時存儲在調用 `camera.getPicture` 後的中間的影像檔。 適用只有當 `Camera.sourceType` 的值等於 `Camera.PictureSourceType.CAMERA` 和 `Camera.destinationType` 等於 `Camera.DestinationType.FILE_URI`. - -### 支援的平臺 - -* iOS - -### 示例 - - navigator.camera.cleanup(onSuccess, onFail); - - function onSuccess() { - console.log("Camera cleanup success.") - } - - function onFail(message) { - alert('Failed because: ' + message); - }