コード例 #1
0
ファイル: Start.java プロジェクト: tiestvilee/DynamOS
  public void setPImage(PImage node) {
    if (this._pImage_ != null) {
      this._pImage_.parent(null);
    }

    if (node != null) {
      if (node.parent() != null) {
        node.parent().removeChild(node);
      }

      node.parent(this);
    }

    this._pImage_ = node;
  }
コード例 #2
0
  public PImage getImpl(int x, int y, int w, int h) {
    PImage output = new PImage(w, h);
    output.parent = parent;

    // oops, the last parameter is the scan size of the *target* buffer
    // ((BufferedImage) image).getRGB(x, y, w, h, output.pixels, 0, w);
    WritableRaster raster = ((BufferedImage) (primarySurface ? offscreen : image)).getRaster();
    raster.getDataElements(x, y, w, h, output.pixels);

    return output;
  }