這只是一些代碼,因爲其他部分是分佈式的,但是在黑莓Curve模擬器上,這會將VideoControl添加到管理器並顯示正常另一個按鈕實際上捕捉圖片。但是,當我在一個實際的黑莓曲線(我認爲是第6版)上運行它時,它不會在屏幕上顯示它。使用VideoControl捕獲黑莓應用程序中的圖像只適用於仿真器而不是設備
try
{
_p = javax.microedition.media.Manager.createPlayer("capture://video?encoding=jpeg&width=1024&height=768");
_p.realize();
_videoControl = (VideoControl) _p.getControl("VideoControl");
if (_videoControl != null)
{
videoField = (Field) _videoControl.initDisplayMode (VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
// _videoControl.setDisplayFullScreen(true);
_videoControl.setVisible(true);
// EnhancedFocusControl efc = (EnhancedFocusControl)p.getControl("net.rim.device.api.amms.control.camera.EnhancedFocusControl");
// efc.startAutoFocus();
_p.start();
if(videoField != null)
{
add(videoField);
}
}
}
catch(Exception e)
{
Dialog.alert(e.toString());
}
我可以指導我如何使用本機相機應用程序?..我是新的BB。 –
@KinjalShah:那是幾年前,所以我不記得細節。雖然我可以說需要使用'FileSystemJournalListener'和'Invoke' API。作爲一個起點(我剛剛搜索了它)看看這裏:http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Still-valid-to-use-FileJournalListener-to-capture -camera圖像/ MP/598208 –