本文整理汇总了Java中com.github.sarxos.webcam.WebcamPanel.setFPSDisplayed方法的典型用法代码示例。如果您正苦于以下问题:Java WebcamPanel.setFPSDisplayed方法的具体用法?Java WebcamPanel.setFPSDisplayed怎么用?Java WebcamPanel.setFPSDisplayed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.sarxos.webcam.WebcamPanel
的用法示例。
在下文中一共展示了WebcamPanel.setFPSDisplayed方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VideoLlamada
import com.github.sarxos.webcam.WebcamPanel; //导入方法依赖的package包/类
public void VideoLlamada() {
Webcam webcam = Webcam.getDefault();
WebcamPanel panel = new WebcamPanel(webcam);
panel.setFPSDisplayed(true);
JFrame window = new JFrame("VIDEO CALL");
window.setTitle("Haciendo videollamada con " + jt_Name_Contacts.getText());
window.setExtendedState(MAXIMIZED_BOTH);
panel.setFillArea(true);
window.add(panel);
window.pack();
window.setVisible(true);
}
示例2: 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);
}
示例3: 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);
}
}
示例4: run
import com.github.sarxos.webcam.WebcamPanel; //导入方法依赖的package包/类
@Override
public void run() {
Webcam.addDiscoveryListener(this);
setTitle("Java Webcam Capture POC");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new BorderLayout());
addWindowListener(this);
picker = new WebcamPicker();
picker.addItemListener(this);
webcam = picker.getSelectedWebcam();
if (webcam == null) {
System.out.println("No webcams found...");
System.exit(1);
}
webcam.setViewSize(WebcamResolution.VGA.getSize());
webcam.addWebcamListener(camara.this);
panel = new WebcamPanel(webcam, false);
panel.setFPSDisplayed(true);
add(picker, BorderLayout.NORTH);
add(panel, BorderLayout.CENTER);
add(boton, BorderLayout.SOUTH);
boton.addActionListener(this);
pack();
setVisible(true);
Thread t = new Thread() {
@Override
public void run() {
panel.start();
}
};
t.setName("example-starter");
t.setDaemon(true);
t.setUncaughtExceptionHandler(this);
t.start();
}
示例5: run
import com.github.sarxos.webcam.WebcamPanel; //导入方法依赖的package包/类
@Override
public void run() {
Webcam.addDiscoveryListener(this);
setTitle("Java Webcam Capture POC");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new BorderLayout());
addWindowListener(this);
picker = new WebcamPicker();
picker.addItemListener(this);
webcam = picker.getSelectedWebcam();
if (webcam == null) {
System.out.println("No webcams found...");
System.exit(1);
}
webcam.setViewSize(WebcamResolution.VGA.getSize());
webcam.addWebcamListener(camara.this);
panel = new WebcamPanel(webcam, false);
panel.setFPSDisplayed(true);
add(picker, BorderLayout.NORTH);
add(panel, BorderLayout.CENTER);
add(boton, BorderLayout.SOUTH);
add(boton1, BorderLayout.NORTH);
boton.addActionListener(this);
boton1.addActionListener(this);
pack();
setVisible(true);
Thread t = new Thread() {
@Override
public void run() {
panel.start();
}
};
t.setName("example-starter");
t.setDaemon(true);
t.setUncaughtExceptionHandler(this);
t.start();
}
示例6: 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();
}
示例7: 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();
}