Package com.opera.core.systems.model

Examples of com.opera.core.systems.model.Canvas


    return captureScreen(timeout, new ArrayList<String>());
  }

  public ScreenCaptureReply captureScreen(long timeout, List<String> knownMD5s) {
    assertElementNotStale();
    Canvas canvas = buildCanvas();
    return exec.screenWatcher(canvas, timeout, true, knownMD5s);
  }
View Full Code Here


  @SuppressWarnings("unused")
  @Deprecated
  public boolean containsColor(OperaColors... colors) {
    assertElementNotStale();

    Canvas canvas = buildCanvas();
    ScreenCaptureReply reply = exec.containsColor(canvas, 100L, colors);

    List<ColorResult> results = reply.getColorResults();

    for (ColorResult result : results) {
View Full Code Here

   * Create a "canvas", which is an object that specifies a rectangle to take a screenshot of.
   *
   * @return a canvas representing the size and position of this element.
   */
  private Canvas buildCanvas() {
    Canvas canvas = new Canvas();
    Dimension dimension = getSize();
    Point point = coordinates.inViewPort();
    int x = point.x;
    int y = point.y;

    // Avoid internal error by making sure we have some width and height
    int w = Math.max(dimension.width, 1);
    int h = Math.max(dimension.height, 1);

    canvas.setX(x);
    canvas.setY(y);
    canvas.setHeight(h);
    canvas.setWidth(w);
    canvas.setViewPortRelative(true);

    return canvas;
  }
View Full Code Here

TOP

Related Classes of com.opera.core.systems.model.Canvas

Copyright © 2018 www.massapicom. 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.