本文整理汇总了Java中com.github.sarxos.webcam.WebcamPanel.setImageSizeDisplayed方法的典型用法代码示例。如果您正苦于以下问题:Java WebcamPanel.setImageSizeDisplayed方法的具体用法?Java WebcamPanel.setImageSizeDisplayed怎么用?Java WebcamPanel.setImageSizeDisplayed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.sarxos.webcam.WebcamPanel
的用法示例。
在下文中一共展示了WebcamPanel.setImageSizeDisplayed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.github.sarxos.webcam.WebcamPanel; //导入方法依赖的package包/类
public static void main(String[] args) throws InterruptedException {
Webcam webcam = Webcam.getDefault();
webcam.setViewSize(WebcamResolution.VGA.getSize());
WebcamPanel panel = new WebcamPanel(webcam);
panel.setFPSDisplayed(true);
// panel.setDisplayDebugInfo(true);
panel.setImageSizeDisplayed(true);
panel.setMirrored(true);
JFrame window = new JFrame("Test webcam panel");
window.add(panel);
window.setResizable(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.pack();
window.setVisible(true);
}
示例2: ma2in
import com.github.sarxos.webcam.WebcamPanel; //导入方法依赖的package包/类
public static void ma2in(String[] args) throws InterruptedException
{
try {
IpCamAuth auth = new IpCamAuth("rovguest", "rov");
IpCamDevice olga = IpCamDeviceRegistry.register("Olga", "http://172.16.65.196:6969/videostream.cgi?loginuse=rovguest&loginpas=rov", IpCamMode.PUSH, auth);
IpCamDevice alexei = IpCamDeviceRegistry.register("Alexei", "http://172.16.65.197:6969/videostream.cgi?loginuse=rovguest&loginpas=rov", IpCamMode.PUSH, auth);
olga.setResolution(WebcamResolution.VGA.getSize());
alexei.setResolution(WebcamResolution.VGA.getSize());
WebcamPanel panel0 = new WebcamPanel(Webcam.getWebcams().get(0));
WebcamPanel panel1 = new WebcamPanel(Webcam.getWebcams().get(1));
panel0.setFPSDisplayed(true);
panel0.setDisplayDebugInfo(true);
panel0.setImageSizeDisplayed(true);
panel1.setFPSDisplayed(true);
panel1.setDisplayDebugInfo(true);
panel1.setImageSizeDisplayed(true);
JFrame window = new JFrame("Test webcam panel");
window.setLayout(new GridBagLayout());
window.add(panel0);
window.add(panel1);
window.setResizable(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.pack();
window.setVisible(true);
} catch(MalformedURLException ex) {
Logger.getLogger(Learning.class.getName()).log(Level.SEVERE, null, ex);
}
}