javax.swing.JFrame.getBufferStrategy()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(147)

本文整理了Java中javax.swing.JFrame.getBufferStrategy()方法的一些代码示例,展示了JFrame.getBufferStrategy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFrame.getBufferStrategy()方法的具体详情如下:
包路径:javax.swing.JFrame
类名称:JFrame
方法名:getBufferStrategy

JFrame.getBufferStrategy介绍

暂无

代码示例

代码示例来源:origin: klamonte/jexer

/**
 * Get the BufferStrategy object needed for triple-buffering.
 *
 * @return the BufferStrategy
 * @throws IllegalArgumentException if this function is called when
 * not rendering to a JFrame
 */
public BufferStrategy getBufferStrategy() {
  if (frame != null) {
    return frame.getBufferStrategy();
  } else {
    throw new IllegalArgumentException("BufferStrategy not used " +
      "for JComponent access");
  }
}

代码示例来源:origin: stackoverflow.com

JFrame jframe = new JFrame ();

...

BufferStrategy bufferstrategy = jframe.getBufferStrategy ();

if (bufferstrategy == null) {
  jframe.createBufferStrategy(3);
  return;
}

g.dispose();
bufferstrategy.show();

代码示例来源:origin: org.deeplearning4j/deeplearning4j-core

public void start() {

    int[] pixels = ((DataBufferInt) img.getRaster().getDataBuffer()).getData();
    boolean running = true;
    while (running) {
      BufferStrategy bs = frame.getBufferStrategy();
      if (bs == null) {
        frame.createBufferStrategy(4);
        return;
      }
      for (int i = 0; i < width * height; i++)
        pixels[i] = 0;

      Graphics g = bs.getDrawGraphics();
      g.drawImage(img, heightOffset, widthOffset, width, height, null);
      g.dispose();
      bs.show();

    }
  }
}

代码示例来源:origin: org.datavec/datavec-data-image

public void start() {

    int[] pixels = ((DataBufferInt) img.getRaster().getDataBuffer()).getData();
    boolean running = true;
    while (running) {
      BufferStrategy bs = frame.getBufferStrategy();
      if (bs == null) {
        frame.createBufferStrategy(4);
        return;
      }
      for (int i = 0; i < width * height; i++)
        pixels[i] = 0;

      Graphics g = bs.getDrawGraphics();
      g.drawImage(img, heightOffset, widthOffset, width, height, null);
      g.dispose();
      bs.show();

    }
  }
}

代码示例来源:origin: org.nd4j/canova-nd4j-image

public void start(){

    int[] pixels = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
    boolean running = true;
    while(running){
      BufferStrategy bs = frame.getBufferStrategy();
      if(bs==null){
        frame.createBufferStrategy(4);
        return;
      }
      for (int i = 0; i < width * height; i++)
        pixels[i] = 0;

      Graphics g= bs.getDrawGraphics();
      g.drawImage(img, heightOffset, widthOffset, width, height, null);
      g.dispose();
      bs.show();

    }
  }
}

代码示例来源:origin: stackoverflow.com

f.createBufferStrategy(2);
BufferStrategy bs = f.getBufferStrategy();
while (true) {
  try {

代码示例来源:origin: stackoverflow.com

final BufferStrategy bs = frame.getBufferStrategy();

代码示例来源:origin: stackoverflow.com

bufferStrategy = frame.getBufferStrategy();

相关文章

JFrame类方法