Examples of PGraphics


Examples of processing.core.PGraphics

    return makeImgDown(img.width, img.height, img);
  }

  public static PImage makeImgOver(int w, int h, PImage img) {

    PGraphics pg = appletStatic.createGraphics(w, h, PApplet.JAVA2D);
    pg.smooth();
    pg.beginDraw();
   
    pg.noStroke();

    pg.smooth();
    pg.strokeWeight(1);
    pg.stroke(200, 200, 200);
    pg.noFill();

    roundrect(pg, 0, 0, w + 4, h + 4, 4); //right bottom border off texture
    int offsetX = (int) ((w - img.width) / 2);
    int offsetY = (int) ((h - img.height) / 2);
    pg.image(img, (int)offsetX, (int)offsetY);
    pg.endDraw();
    return pg;

  }
View Full Code Here

Examples of processing.core.PGraphics

    return makeImgOver(img.width, img.height, img);
  }

  public static PImage makeImgUp(float w, float h, PImage img) {

    PGraphics pg = appletStatic.createGraphics((int) w, (int) h,
        PApplet.JAVA2D );
    pg.smooth();
    pg.beginDraw();
    pg.smooth();
   
    pg.noStroke();

    pg.stroke(200, 200, 200);
    pg.fill(255, 255, 255);

    int offsetX = (int) ((w - img.width) / 2);
    int offsetY = (int) ((h - img.height) / 2);
    pg.image(img, (int)offsetX, (int)offsetY);
    pg.endDraw();
    return pg;

  }
View Full Code Here

Examples of processing.core.PGraphics

   
    g.textSize(this.textSize);
    int ln = countLines(str);
    float w = (int)g.textWidth(str) + 4;
    float h = (getController().labelSize + g.textDescent()+ g.textAscent()) * ln;
    PGraphics textG = getController().appletStatic.createGraphics((int) w,
        (int) h, PApplet.OPENGL);
   
    this.setSize(w, h);
    textG.beginDraw();
    textG.smooth(2);
    //textG.background(255);
   
    //textG.textMode(PApplet.SCREEN);
    textG.textSize(this.textSize);
    textG.textFont(getController().myFontMedium,this.textSize);
    //textG.textFont(myFont);
    //textG.textMode(PApplet.SCREEN);
    //textG.alpha(1);
    //textG.background(255, 255, 255, 0);
    textG.fill(0);
   
   
    //LOGGER.info("s"+this.textSize);
    /*
    LOGGER.info(this.labelStr);
    g.printMatrix();
    g.printCamera();
    g.printProjection();
    */ 
   
    textG.text(
        str,
        2,
        h
            - (g.textDescent()+g.textAscent() - 1)
            - ((getController().labelSize + g.textDescent() + 1) * (ln - 1)));
    textG.endDraw();
    this.preRenderedLabel = textG.get();
  }
View Full Code Here

Examples of processing.core.PGraphics

  }
 
  @Before
  public void setup() {
    PApplet applet = new PApplet();
    applet.g = new PGraphics();
    Hermes.setPApplet(applet);
    applet.rectMode(PApplet.CENTER);
  }
View Full Code Here

Examples of processing.core.PGraphics

  }
 
  @Before
  public void setup() {
    PApplet applet = new PApplet();
    applet.g = new PGraphics();
    Hermes.setPApplet(applet);
    applet.rectMode(PApplet.CENTER);
  }
View Full Code Here

Examples of processing.core.PGraphics

  }
 
  @Before
  public void setup() {
    PApplet applet = new PApplet();
    applet.g = new PGraphics();
    Hermes.setPApplet(applet);
    applet.rectMode(PApplet.CENTER);
  }
View Full Code Here

Examples of processing.core.PGraphics

        if (alpha > 255) {
            alpha = 255;
        }

        //Graphics
        PGraphics graphics = target.getGraphics();

        if (borderSize > 0) {
            graphics.stroke(borderColor.getRed(), borderColor.getGreen(), borderColor.getBlue(), alpha);
            graphics.strokeWeight(borderSize);
        } else {
            graphics.noStroke();
        }
        graphics.fill(color.getRed(), color.getGreen(), color.getBlue(), alpha);
        graphics.rect(x, y, size, size);
    }
View Full Code Here

Examples of processing.core.PGraphics

    // Stores information of the current state of the map
    this.location = map.getCenter();
    this.zoomLevel = map.getZoomLevel();

    // Stores image data of the current map
    PGraphics pg = map.mapDisplay.getOuterPG();
    thumbnail = pg.get();
  }
View Full Code Here

Examples of processing.core.PGraphics

    }
    offscreenCutoffPG.endDraw();

    // Transforms (outer) map pane, and draws inner map + marker onto canvas
    // This cuts off marker at the border.
    PGraphics canvasPG = papplet.g;
    canvasPG.pushMatrix();
    canvasPG.translate(offsetX, offsetY);
    canvasPG.applyMatrix(matrix);
   
    textureDistorter.draw(canvasPG, offscreenPG);
    //canvasPG.image(offscreenCutoffPG.getTexture(), 0, 0);
    canvasPG.popMatrix();
  }
View Full Code Here

Examples of processing.core.PGraphics

   * Draws this marker onto the map. Converts the geo-location to object position, and calls
   * {@link #draw(PGraphics, float, float, UnfoldingMap)}.
   */
  @Override
  public void draw(UnfoldingMap map) {
    PGraphics pg = map.mapDisplay.getOuterPG();
    float[] xy = map.mapDisplay.getObjectFromLocation(getLocation());
    float x = xy[0];
    float y = xy[1];
    draw(pg, x, y, map);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.