本文整理汇总了Java中com.github.sarxos.webcam.WebcamPanel.setDisplayDebugInfo方法的典型用法代码示例。如果您正苦于以下问题:Java WebcamPanel.setDisplayDebugInfo方法的具体用法?Java WebcamPanel.setDisplayDebugInfo怎么用?Java WebcamPanel.setDisplayDebugInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.sarxos.webcam.WebcamPanel
的用法示例。
在下文中一共展示了WebcamPanel.setDisplayDebugInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: connectCam
import com.github.sarxos.webcam.WebcamPanel; //导入方法依赖的package包/类
private void connectCam() {
olga = Webcam.getWebcams().get(0);
olga.setImageTransformer((BufferedImage image) -> {
int w = image.getWidth();
int h = image.getHeight();
BufferedImage modified = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = modified.createGraphics();
g2.drawImage(image, w, h, -w, -h, null);
g2.dispose();
modified.flush();
return modified;
});
WebcamPanel subOlga = new WebcamPanel(olga);
subOlga.setFPSDisplayed(true);
subOlga.setDisplayDebugInfo(true);
subOlga.setFPSLimit(60);
olgaPanel.removeAll();
olgaPanel.add(subOlga);
olgaPanel.revalidate();
olgaPanel.repaint();
alexei = Webcam.getWebcams().get(1);
WebcamPanel subAlexei = new WebcamPanel(alexei);
subAlexei.setFPSDisplayed(true);
subAlexei.setDisplayDebugInfo(true);
subAlexei.setFPSLimit(60);
alexeiPanel.removeAll();
alexeiPanel.add(subAlexei);
alexeiPanel.revalidate();
alexeiPanel.repaint();
maria = Webcam.getWebcams().get(2);
WebcamPanel subMaria = new WebcamPanel(maria);
subMaria.setFPSDisplayed(true);
subMaria.setDisplayDebugInfo(true);
subMaria.setFPSLimit(60);
mariaPanel.removeAll();
mariaPanel.add(subMaria);
mariaPanel.revalidate();
mariaPanel.repaint();
pack();
}
示例3: connectCam
import com.github.sarxos.webcam.WebcamPanel; //导入方法依赖的package包/类
private void connectCam()
{
olga = Webcam.getWebcams().get(0);
olga.setImageTransformer(new WebcamImageTransformer()
{
@Override
public BufferedImage transform(BufferedImage image)
{
int w = image.getWidth();
int h = image.getHeight();
BufferedImage modified = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = modified.createGraphics();
g2.drawImage(image, w, h, -w, -h, null);
g2.dispose();
modified.flush();
return modified;
}
});
WebcamPanel subOlga = new WebcamPanel(olga);
subOlga.setFPSDisplayed(true);
subOlga.setDisplayDebugInfo(true);
subOlga.setFPSLimit(60);
olgaPanel.removeAll();
olgaPanel.add(subOlga);
olgaPanel.revalidate();
olgaPanel.repaint();
alexei = Webcam.getWebcams().get(1);
WebcamPanel subAlexei = new WebcamPanel(alexei);
subAlexei.setFPSDisplayed(true);
subAlexei.setDisplayDebugInfo(true);
subAlexei.setFPSLimit(60);
alexeiPanel.removeAll();
alexeiPanel.add(subAlexei);
alexeiPanel.revalidate();
alexeiPanel.repaint();
maria = Webcam.getWebcams().get(2);
WebcamPanel subMaria = new WebcamPanel(maria);
subMaria.setFPSDisplayed(true);
subMaria.setDisplayDebugInfo(true);
subMaria.setFPSLimit(60);
mariaPanel.removeAll();
mariaPanel.add(subMaria);
mariaPanel.revalidate();
mariaPanel.repaint();
pack();
}