本文整理汇总了Java中org.bytedeco.javacv.CanvasFrame.setDefaultCloseOperation方法的典型用法代码示例。如果您正苦于以下问题:Java CanvasFrame.setDefaultCloseOperation方法的具体用法?Java CanvasFrame.setDefaultCloseOperation怎么用?Java CanvasFrame.setDefaultCloseOperation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bytedeco.javacv.CanvasFrame
的用法示例。
在下文中一共展示了CanvasFrame.setDefaultCloseOperation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JavavcCameraTest
import org.bytedeco.javacv.CanvasFrame; //导入方法依赖的package包/类
public JavavcCameraTest(int deviceNumber) throws Exception {
super(deviceNumber);
start(); // 开始获取摄像头数据
// TODO Auto-generated constructor stub
CanvasFrame canvas = new CanvasFrame("摄像头");
canvas.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
canvas.setAlwaysOnTop(true);
canvas.setResizable(true);
while (true) {
if (!canvas.isDisplayable()) {// 窗口是否关闭
stop();// 停止抓取
System.exit(2);// 退出
}
canvas.showImage(grab());// 获取摄像头图像并放到窗口上显示, 这里的Frame
Frame frame=grab();
// frame是一帧视频图像
try {
Thread.sleep(50);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}// 50毫秒刷新一次图像
}
}
示例2: show
import org.bytedeco.javacv.CanvasFrame; //导入方法依赖的package包/类
public void show(final Mat imageMat, final String title) {
IplImage image = converterToIpl.convertToIplImage(converterToIpl.convert(imageMat));
final IplImage image1 = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, image.nChannels());
cvCopy(image, image1);
CanvasFrame canvas = new CanvasFrame(title, 1);
canvas.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
final OpenCVFrameConverter.ToIplImage converter = new OpenCVFrameConverter.ToIplImage();
canvas.showImage(converter.convert(image1));
}
示例3: show
import org.bytedeco.javacv.CanvasFrame; //导入方法依赖的package包/类
public void show(final Mat imageMat, final String title) {
IplImage image = converterToIpl.convertToIplImage(converterToIpl.convert(imageMat));
final IplImage image1 = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, image.nChannels());
cvCopy(image, image1);
CanvasFrame canvas = new CanvasFrame(title, 1);
canvas.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
canvas.showImage(converterToIpl.convert(image1));
}
示例4: ShowImage
import org.bytedeco.javacv.CanvasFrame; //导入方法依赖的package包/类
public static void ShowImage(IplImage image, String caption, int width, int height)
{
CanvasFrame canvas = new CanvasFrame(caption, 1); // gamma=1
canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
canvas.setCanvasSize(width, height);
canvas.showImage(image);
}