Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

CameraCapture

The CameraCapture type provides an interface for capturing camera images More...

Inherits QtObject

Signals

Methods

Detailed Description

This type allows you to capture still images and be notified when they are available or saved to disk. You can adjust the resolution of the captured image and where the saved image should go.

CameraCapture is a child of a Camera (as the imageCapture property) and cannot be created directly.

 import QtQuick 2.0
 import QtMultimedia 5.0

 Item {
     width: 640
     height: 360

     Camera {
         id: camera

         imageCapture {
             onImageCaptured: {
                 // Show the preview in an Image
                 photoPreview.source = preview
             }
         }
     }

     VideoOutput {
         source: camera
         focus : visible // to receive focus and capture key events when visible
         anchors.fill: parent

         MouseArea {
             anchors.fill: parent;
             onClicked: camera.imageCapture.capture();
         }
     }

     Image {
         id: photoPreview
     }
 }

Signal Documentation

CameraCapture::onCaptureFailed(requestId, message)

This handler is called when an error occurs during capture with requestId. A descriptive message is available in message.


CameraCapture::onImageCaptured(requestId, preview)

This handler is called when an image with requestId has been captured but not yet saved to the filesystem. The preview parameter can be used as the URL supplied to an Image.

See also onImageSaved.


CameraCapture::onImageMetadataAvailable(requestId, key, value)

This handler is called when the image with requestId has new metadata available with the key key and value value.

See also onImageCaptured.


CameraCapture::onImageSaved(requestId, path)

This handler is called after the image with requestId has been written to the filesystem. The path is a local file path, not a URL.

See also onImageCaptured.


Method Documentation

CameraCapture::cancelCapture()

Cancel pending image capture requests.


CameraCapture::capture()

Start image capture. The onImageCaptured() and onImageSaved() signals will be emitted when the capture is complete.

The image will be captured to the default system location, typically QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) for still imaged or QStandardPaths::writableLocation(QStandardPaths::MoviesLocation) for video.

Camera saves all the capture parameters like exposure settings or image processing parameters, so changes to camera paramaters after capture() is called do not affect previous capture requests.

CameraCapture::capture returns the capture requestId parameter, used with imageExposed(), imageCaptured(), imageMetadataAvailable() and imageSaved() signals.


CameraCapture::captureToLocation(location)

Start image capture to specified location. The onImageCaptured() and onImageSaved() signals will be emitted when the capture is complete.

CameraCapture::captureToLocation returns the capture requestId parameter, used with imageExposed(), imageCaptured(), imageMetadataAvailable() and imageSaved() signals.

If the application is unable to write to the location specified by location the CameraCapture will emit an error. The most likely reasons for the application to be unable to write to a location is that the path is wrong and the location does not exists, or the application does not have write permission for that location.


CameraCapture::setMetadata(key, value)

Sets a particular metadata key to value for the subsequent image captures.

See also QtMultimedia::MetaData.


Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web