资源简介
zbar条码识别库,支持Windows32位和64位版本。
代码片段和文件信息
/*
* Barebones implementation of displaying camera preview.
*
* Created by lisah0 on 2012-02-24
*/
package net.sourceforge.zbar.android.CameraTest;
import java.io.IOException;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Surface;
import android.view.SurfaceView;
import android.view.SurfaceHolder;
import android.content.Context;
import android.hardware.Camera;
import android.hardware.Camera.PreviewCallback;
import android.hardware.Camera.AutoFocusCallback;
import android.hardware.Camera.Parameters;
/** A basic Camera preview class */
public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback {
private SurfaceHolder mHolder;
private Camera mCamera;
private PreviewCallback previewCallback;
private AutoFocusCallback autoFocusCallback;
public CameraPreview(Context context Camera camera
PreviewCallback previewCb
AutoFocusCallback autoFocusCb) {
super(context);
mCamera = camera;
previewCallback = previewCb;
autoFocusCallback = autoFocusCb;
/*
* Set camera to continuous focus if supported otherwise use
* software auto-focus. Only works for API level >=9.
*/
/*
Camera.Parameters parameters = camera.getParameters();
for (String f : parameters.getSupportedFocusModes()) {
if (f == Parameters.FOCUS_MODE_CONTINUOUS_PICTURE) {
mCamera.setFocusMode(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
autoFocusCallback = null;
break;
}
}
*/
// Install a SurfaceHolder.Callback so we get notified when the
// underlying surface is created and destroyed.
mHolder = getHolder();
mHolder.addCallback(this);
// deprecated setting but required on Android versions prior to 3.0
mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
public void surfaceCreated(SurfaceHolder holder) {
// The Surface has been created now tell the camera where to draw the preview.
try {
mCamera.setPreviewDisplay(holder);
} catch (IOException e) {
Log.d(“DBG“ “Error setting camera preview: “ + e.getMessage());
}
}
public void surfaceDestroyed(SurfaceHolder holder) {
// Camera preview released in activity
}
public void surfaceChanged(SurfaceHolder holder int format int width int height) {
/*
* If your preview can change or rotate take care of those events here.
* Make sure to stop the preview before resizing or reformatting it.
*/
if (mHolder.getSurface() == null){
// preview surface does not exist
return;
}
// stop preview before making changes
try {
mCamera.stopPreview();
} catch (Excep
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 461 2015-03-09 09:36 ZBarWin64-master\.hgignore
....... 628 2015-03-09 09:36 ZBarWin64-master\android\AndroidManifest.xm
....... 696 2015-03-09 09:36 ZBarWin64-master\android\ant.properties
....... 2816 2015-03-09 09:36 ZBarWin64-master\android\build-ndk.xm
....... 3494 2015-03-09 09:36 ZBarWin64-master\android\build.xm
....... 58 2015-03-09 09:36 ZBarWin64-master\android\ChangeLog
....... 876 2015-03-09 09:36 ZBarWin64-master\android\examples\CameraTest\AndroidManifest.xm
....... 696 2015-03-09 09:36 ZBarWin64-master\android\examples\CameraTest\ant.properties
....... 3359 2015-03-09 09:36 ZBarWin64-master\android\examples\CameraTest\build.xm
....... 1248 2015-03-09 09:36 ZBarWin64-master\android\examples\CameraTest\proguard.cfg
....... 361 2015-03-09 09:36 ZBarWin64-master\android\examples\CameraTest\project.properties
....... 770 2015-03-09 09:36 ZBarWin64-master\android\examples\CameraTest\res\layout\main.xm
....... 117 2015-03-09 09:36 ZBarWin64-master\android\examples\CameraTest\res\values\strings.xm
....... 3550 2015-03-09 09:36 ZBarWin64-master\android\examples\CameraTest\src\net\sourceforge\zbar\android\CameraTest\CameraPreview.java
....... 4677 2015-03-09 09:36 ZBarWin64-master\android\examples\CameraTest\src\net\sourceforge\zbar\android\CameraTest\CameraTestActivity.java
....... 1757 2015-03-09 09:36 ZBarWin64-master\android\jni\Android.mk
....... 35 2015-03-09 09:36 ZBarWin64-master\android\jni\Application.mk
....... 6691 2015-03-09 09:36 ZBarWin64-master\android\jni\config.h
....... 1248 2015-03-09 09:36 ZBarWin64-master\android\proguard.cfg
....... 381 2015-03-09 09:36 ZBarWin64-master\android\project.properties
....... 3634 2015-03-09 09:36 ZBarWin64-master\android\README
....... 402 2015-03-09 09:36 ZBarWin64-master\android\res\layout\main.xm
....... 121 2015-03-09 09:36 ZBarWin64-master\android\res\values\strings.xm
....... 29465 2015-03-09 09:36 ZBarWin64-master\ChangeLog
....... 0 2015-03-09 09:36 ZBarWin64-master\config\.keep
文件 18343 2015-03-09 09:36 ZBarWin64-master\config\config.rpath
....... 20896 2015-03-09 09:36 ZBarWin64-master\configure.ac
....... 1279 2015-03-09 09:36 ZBarWin64-master\COPYING
文件 10912 2017-08-22 11:22 ZBarWin64-master\Debug\bch15_5.obj
文件 26716 2017-08-22 11:22 ZBarWin64-master\Debug\binarize.obj
............此处省略524个文件信息
相关资源
- 安川机器人编程语言INFORM中文解说
- 《Windows网络编程技术》高清PDF版+随书
- Microsoft.Windows.Cortana_cw5n1h2txyewy.zip
- Windows IoT应用开发指南
- zw_WINDOWSAPI程序设计参考大全.zip
- DellR720通过U盘安装windows2008R2
- 绘制哆啦A梦.zip
- Microstrip Filters for RF Microwave Applicatio
- Windows CE 7.0中文版ARM
-
actionsc
ript for multipla yer Games and v - Windows命令行详解手册(第2版)
- Farmacia4LN.zip
- pandoc-2.8-windows-x86_64.msi
- Microstrip Filters for RF Microwave Applicatio
- WINDOWS API程序设计参考大全.pdf
- Inside Windows Debugging.pdf
- Mastering_ROS_for_Robotics_Programming.pdf
- WINDOWS PE.GHO
- Windows Server 2012 R2 安装NetFx3。镜像文件
- 5G technique for MMW
- CS231 卷积神经网络(中文版带书签)
- Windows网络编程第二版 中文、英文版(
- SingleSensorImagingMethodsandApplicationsforDi
- a mind for numbers - barbaraoakley学习之道英
- windows下的git安装包
- WindowsStore_LTSC2019LTSC 自动恢复 win10 应
- ESD Design for Analog Circuits
- LINGO-WINDOWS-64x86-12.0
- Windows Mobile设备中心64位
- WindowsFormsApp3.zip
评论
共有 条评论