本文整理汇总了Java中com.jogamp.opengl.awt.GLCanvas.setBounds方法的典型用法代码示例。如果您正苦于以下问题:Java GLCanvas.setBounds方法的具体用法?Java GLCanvas.setBounds怎么用?Java GLCanvas.setBounds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.awt.GLCanvas
的用法示例。
在下文中一共展示了GLCanvas.setBounds方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JavaSimpleLite_ImageSource
import com.jogamp.opengl.awt.GLCanvas; //导入方法依赖的package包/类
public JavaSimpleLite_ImageSource(NyARParam i_param, NyARCode i_ar_code,BufferedImage i_image) throws NyARRuntimeException,IOException
{
this._ar_param = i_param;
Frame frame = new Frame("NyARToolkit["+this.getClass().getName()+"]");
// NyARToolkitの準備
this._nya = NyARSingleDetectMarker.createInstance(this._ar_param, i_ar_code, 80.0,NyARSingleDetectMarker.PF_NYARTOOLKIT);
this._nya.setContinueMode(false);// ここをtrueにすると、transMatContinueモード(History計算)になります。
//load bitmap image
this._src_image =new NyARBufferedImageRaster(i_image);
// 3Dを描画するコンポーネント
GLCanvas canvas = new GLCanvas();
frame.add(canvas);
canvas.addGLEventListener(this);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
frame.setVisible(true);
Insets ins = frame.getInsets();
frame.setSize(i_image.getWidth() + ins.left + ins.right, i_image.getHeight() + ins.top + ins.bottom);
canvas.setBounds(ins.left, ins.top, i_image.getWidth(), i_image.getHeight());
}
示例2: JavaSimpleLite
import com.jogamp.opengl.awt.GLCanvas; //导入方法依赖的package包/类
public JavaSimpleLite(NyARParam i_param, NyARCode i_ar_code) throws NyARRuntimeException
{
this._ar_param = i_param;
Frame frame = new Frame("NyARToolkit["+this.getClass().getName()+"]");
// キャプチャの準備
JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();
this._capture = devlist.getDevice(0);
if (!this._capture.setCaptureFormat(SCREEN_X, SCREEN_Y, 30.0f)) {
throw new NyARRuntimeException();
}
this._capture.setOnCapture(this);
//JMFラスタオブジェクト
this._cap_image = new JmfNyARRGBRaster(this._capture.getCaptureFormat());
// NyARToolkitの準備
this._nya = NyARSingleDetectMarker.createInstance(this._ar_param, i_ar_code, 80.0);
this._nya.setContinueMode(true);// ここをtrueにすると、transMatContinueモード(History計算)になります。
// 3Dを描画するコンポーネント
GLCanvas canvas = new GLCanvas();
frame.add(canvas);
canvas.addGLEventListener(this);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e)
{
_capture.stop();
System.exit(0);
}
});
frame.setVisible(true);
Insets ins = frame.getInsets();
frame.setSize(SCREEN_X + ins.left + ins.right, SCREEN_Y + ins.top + ins.bottom);
canvas.setBounds(ins.left, ins.top, SCREEN_X, SCREEN_Y);
}
示例3: SingleARMarker
import com.jogamp.opengl.awt.GLCanvas; //导入方法依赖的package包/类
public SingleARMarker(NyARParam i_cparam) throws Exception
{
JmfCaptureDeviceList devlist=new JmfCaptureDeviceList();
this._ar_param=i_cparam;
//キャプチャリソースの準備
this._capture=devlist.getDevice(0);
if(!this._capture.setCaptureFormat(SCREEN_X, SCREEN_Y,30.0f)){
throw new NyARRuntimeException();
}
this._capture.setOnCapture(this);
this._cap_image = new JmfNyARRGBRaster(this._capture.getCaptureFormat());
this._code_table[0]=NyARCode.loadFromARPattFile(new FileInputStream(CARCODE_FILE1),16,16);
this._code_table[1]=NyARCode.loadFromARPattFile(new FileInputStream(CARCODE_FILE2),16,16);
//OpenGLフレームの準備(OpenGLリソースの初期化、カメラの撮影開始は、initコールバック関数内で実行)
Frame frame = new Frame("NyARToolkit["+this.getClass().getName()+"]");
GLCanvas canvas = new GLCanvas();
frame.add(canvas);
canvas.addGLEventListener(this);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
//ウインドウサイズの調整
frame.setVisible(true);
Insets ins = frame.getInsets();
frame.setSize(SCREEN_X + ins.left + ins.right, SCREEN_Y + ins.top + ins.bottom);
canvas.setBounds(ins.left, ins.top, SCREEN_X, SCREEN_Y);
return;
}
示例4: SingleNyIdMarker
import com.jogamp.opengl.awt.GLCanvas; //导入方法依赖的package包/类
public SingleNyIdMarker(NyARParam i_cparam) throws NyARRuntimeException
{
JmfCaptureDeviceList devlist=new JmfCaptureDeviceList();
this._ar_param=i_cparam;
//キャプチャリソースの準備
this._capture=devlist.getDevice(0);
if(!this._capture.setCaptureFormat(SCREEN_X, SCREEN_Y,30.0f)){
throw new NyARRuntimeException();
}
this._capture.setOnCapture(this);
this._cap_image = new JmfNyARRGBRaster(this._capture.getCaptureFormat());
//OpenGLフレームの準備(OpenGLリソースの初期化、カメラの撮影開始は、initコールバック関数内で実行)
Frame frame = new Frame("NyARToolkit["+this.getClass().getName()+"]");
GLCanvas canvas = new GLCanvas();
frame.add(canvas);
canvas.addGLEventListener(this);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
//ウインドウサイズの調整
frame.setVisible(true);
Insets ins = frame.getInsets();
frame.setSize(SCREEN_X + ins.left + ins.right, SCREEN_Y + ins.top + ins.bottom);
canvas.setBounds(ins.left, ins.top, SCREEN_X, SCREEN_Y);
return;
}
示例5: SimpleLiteMStandard
import com.jogamp.opengl.awt.GLCanvas; //导入方法依赖的package包/类
public SimpleLiteMStandard(INyARMarkerSystemConfig i_config) throws NyARRuntimeException
{
JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();
JmfCaptureDevice d = devlist.getDevice(0);
d.setCaptureFormat(i_config.getScreenSize(),30.0f);
this._camera=new NyARJmfCamera(d);//create sensor system
this._nyar=new NyARGlMarkerSystem(i_config); //create MarkerSystem
this.ids[0]=this._nyar.addARMarker(ARCODE_FILE2,16,25,80);
this.ids[1]=this._nyar.addARMarker(ARCODE_FILE,16,25,80);
Frame frame= new Frame("NyARTK program");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
GLCanvas canvas = new GLCanvas();
frame.add(canvas);
canvas.addGLEventListener(this);
NyARIntSize s=i_config.getNyARSingleCameraView().getARParam().getScreenSize();
frame.setVisible(true);
Insets ins = frame.getInsets();
frame.setSize(s.w + ins.left + ins.right,s.h + ins.top + ins.bottom);
canvas.setBounds(ins.left, ins.top, s.w,s.h);
this._camera.start();
}