本文整理汇总了Java中com.github.sarxos.webcam.WebcamPanel.setFPSLimit方法的典型用法代码示例。如果您正苦于以下问题:Java WebcamPanel.setFPSLimit方法的具体用法?Java WebcamPanel.setFPSLimit怎么用?Java WebcamPanel.setFPSLimit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.sarxos.webcam.WebcamPanel
的用法示例。
在下文中一共展示了WebcamPanel.setFPSLimit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}