本文整理匯總了Java中android.hardware.Camera.setOneShotPreviewCallback方法的典型用法代碼示例。如果您正苦於以下問題:Java Camera.setOneShotPreviewCallback方法的具體用法?Java Camera.setOneShotPreviewCallback怎麽用?Java Camera.setOneShotPreviewCallback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.hardware.Camera
的用法示例。
在下文中一共展示了Camera.setOneShotPreviewCallback方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: requestPreviewFrame
import android.hardware.Camera; //導入方法依賴的package包/類
/**
* A single preview frame will be returned to the handler supplied. The data
* will arrive as byte[] in the message.obj field, with width and height
* encoded as message.arg1 and message.arg2, respectively.
*
* @param handler
* The handler to send the message to.
* @param message
* The what field of the message to be sent.
*/
public synchronized void requestPreviewFrame(Handler handler, int message) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler, message);
theCamera.setOneShotPreviewCallback(previewCallback);
}
}
示例2: requestPreviewFrame
import android.hardware.Camera; //導入方法依賴的package包/類
/**
* A single preview frame will be returned to the handler supplied. The data will arrive as byte[]
* in the message.obj field, with width and height encoded as message.arg1 and message.arg2,
* respectively.
*
* @param handler The handler to send the message to.
* @param message The what field of the message to be sent.
*/
public synchronized void requestPreviewFrame(Handler handler, int message) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler, message);
theCamera.setOneShotPreviewCallback(previewCallback);
}
}
示例3: requestPreviewFrame
import android.hardware.Camera; //導入方法依賴的package包/類
/**
* A single preview frame will be returned to the handler supplied. The data
* will arrive as byte[] in the message.obj field, with width and height
* encoded as message.arg1 and message.arg2, respectively.
*
* @param handler The handler to send the message to.
* @param message The what field of the message to be sent.
*/
public synchronized void requestPreviewFrame(Handler handler, int message) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler, message);
theCamera.setOneShotPreviewCallback(previewCallback);
}
}
示例4: requestPreviewFrame
import android.hardware.Camera; //導入方法依賴的package包/類
/**
* A single preview frame will be returned to the supplied callback.
*
* The thread on which this called is undefined, so a Handler should be used to post the result
* to the correct thread.
*
* @param callback The callback to receive the preview.
*/
public void requestPreviewFrame(PreviewCallback callback) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
cameraPreviewCallback.setCallback(callback);
theCamera.setOneShotPreviewCallback(cameraPreviewCallback);
}
}
示例5: requestPreviewFrame
import android.hardware.Camera; //導入方法依賴的package包/類
/**
* A single preview frame will be returned to the handler supplied. The data will arrive as byte[]
* in the message.obj field, with width and height encoded as message.arg1 and message.arg2,
* respectively.
*
* @param handler The handler to send the message to.
* @param message The what field of the message to be sent.
*/
public synchronized void requestPreviewFrame(Handler handler, int message) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler, message);
theCamera.setOneShotPreviewCallback(previewCallback);
}
}
示例6: requestPreviewFrame
import android.hardware.Camera; //導入方法依賴的package包/類
/**
* A single preview frame will be returned to the handler supplied. The data
* will arrive as byte[] in the message.obj field, with width and height
* encoded as message.arg1 and message.arg2, respectively. <br/>
*
* 兩個綁定操作:<br/>
* 1:將handler與回調函數綁定;<br/>
* 2:將相機與回調函數綁定<br/>
* 綜上,該函數的作用是當相機的預覽界麵準備就緒後就會調用hander向其發送傳入的message
*
* @param handler
* The handler to send the message to.
* @param message
* The what field of the message to be sent.
*/
public synchronized void requestPreviewFrame(Handler handler, int message) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler, message);
// 綁定相機回調函數,當預覽界麵準備就緒後會回調Camera.PreviewCallback.onPreviewFrame
theCamera.setOneShotPreviewCallback(previewCallback);
}
}