<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 獲取Android設(shè)備上的詳細(xì)的攝像頭信息

          獲取Android設(shè)備上的詳細(xì)的攝像頭信息

          作者: 時間:2016-10-08 來源:網(wǎng)絡(luò) 收藏

          本文引用地址:http://www.ex-cimer.com/article/201610/305681.htm

          package=wjh.android.takepicture

          android:versionCode=1

          android:versionName=1.0>

          package=wjh.android.takepicture

          android:versionCode=1

          android:versionName=1.0>

          ** main.xml

          view plaincopy to clipboardprint?

          android:orientation=vertical

          android:layout_width=fill_parent

          android:layout_height=fill_parent

          >

          android:layout_width=fill_parent

          android:layout_height=fill_parent

          />

          android:orientation=vertical

          android:layout_width=fill_parent

          android:layout_height=fill_parent

          >

          android:layout_width=fill_parent

          android:layout_height=fill_parent

          />

          ** MainActicity

          view plaincopy to clipboardprint?

          public class MainActicity extends Activity {

          private Camera camera;

          private boolean preview = false ;

          @Override

          public void onCreate(Bundle savedInstanceState) {

          super.onCreate(savedInstanceState);

          /*

          *設(shè)置窗口屬性:一定要在 setContentView(R.layout.main) 之前

          */

          // 窗口標(biāo)題

          requestWindowFeature(Window.FEATURE_NO_TITLE);

          // 全屏

          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

          setContentView(R.layout.main);

          SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceView);

          surfaceView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

          surfaceView.getHolder().setFixedSize(176, 164);

          surfaceView.getHolder().addCallback(new SurfaceViewCallback());

          }

          private final class SurfaceViewCallback implements Callback {

          /**

          * surfaceView 被創(chuàng)建成功后調(diào)用此方法

          */

          @Override

          public void surfaceCreated(SurfaceHolder holder) {

          /*

          * 在SurfaceView創(chuàng)建好之后 打開攝像頭

          * 注意是 android.hardware.Camera

          */

          camera = Camera.open();

          Camera.Parameters parameters = camera.getParameters();



          關(guān)鍵詞:

          評論


          相關(guān)推薦

          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();