Associer la webcam a un videoview
Bonjour,
J’essaie d'afficher ma caméra dans une fenêtre mon videoView1 mais pas moyen,
Comment faire?
Voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| import android.app.Activity;
//import android.content.ContextWrapper;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.hardware.Camera;
import com.test.android.Interface.R;
public class InterfaceActivity extends Activity {
/** Called when the activity is first created.
* @param Camera */
public void setCamera(Camera c){
}
package com.test.android.Interface;
public class Camera {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
}
} |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <VideoView
android:id="@+id/Camera"
android:layout_width="320dp"
android:layout_height="240dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="120dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:drawingCacheQuality="auto"
ns:layout="center_horizontal" android:focusable="true"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" /> |