Examples of copyArea()


Examples of org.eclipse.swt.graphics.GC.copyArea()

      Rectangle start = Geometry.toControl(theShell, rect);
      startRects.add(start);
     
      Image image = new Image(display, rect.width, rect.height);
      GC gc = new GC(display);
      gc.copyArea(image, rect.x, rect.y);
      gc.dispose();
     
      ImageCanvas canvas = new ImageCanvas(theShell, SWT.BORDER | SWT.NO_BACKGROUND, image);
      controls.add(canvas);
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.GC.copyArea()

      // Create the result image
      Rectangle shellBounds = getBounds();
      Image image = new Image(Display.getCurrent(), shellBounds.width, shellBounds.height);
      // Manually copy because the image's data handle isn't available
      GC gc = new GC(tempImage);
      gc.copyArea(image, 0, 0);
      gc.dispose();
      // Dispose of the temporary image allocated in the native call
      tempImage.dispose();
      return image;
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.GC.copyArea()

     */
    public void save(String filename, int format) {
        Point size = getSize();
        GC gc = new GC(this);
        Image image = new Image(Display.getDefault(), size.x, size.y);
        gc.copyArea(image, 0, 0);
        gc.dispose();

        ImageData data = image.getImageData();
        ImageLoader loader = new ImageLoader();
        loader.data = new ImageData[] { data };
View Full Code Here

Examples of org.eclipse.swt.graphics.GC.copyArea()

      Rectangle bounds = display.getBounds();
      int width = bounds.width;
      int height = bounds.height;

      Image image = new Image(display, width, height);
      gc.copyArea(image, 0, 0);
      ImageLoader imageLoader = new ImageLoader();
      imageLoader.data = new ImageData[] { image.getImageData() };
      imageLoader.save(fileName, SWT.IMAGE_PNG);
      return true;
    } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.swt.graphics.GC.copyArea()

      Rectangle bounds = display.getBounds();
      int width = bounds.width;
      int height = bounds.height;

      Image image = new Image(display, width, height);
      gc.copyArea(image, 0, 0);
      ImageLoader imageLoader = new ImageLoader();
      imageLoader.data = new ImageData[] { image.getImageData() };
      imageLoader.save(fileName, SWT.IMAGE_PNG);
      return true;
    } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.swt.graphics.GC.copyArea()

      parentDir.mkdirs();
    try {
      log.debug(MessageFormat.format("Capturing screenshot ''{0}''", fileName)); //$NON-NLS-1$

      image = new Image(display, bounds.width, bounds.height);
      gc.copyArea(image, bounds.x, bounds.y);
      ImageLoader imageLoader = new ImageLoader();
      imageLoader.data = new ImageData[] { image.getImageData() };
      imageLoader.save(fileName, new ImageFormatConverter().imageTypeOf(fileName.substring(fileName.lastIndexOf('.') + 1)));
      return true;
    } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.swt.graphics.GC.copyArea()

    int buttonX = cSize.x / 4;
    Image[] images = new Image[4];

    for (int i = 0; i < 4; i++) {
      Image image = new Image(display, buttonX, cSize.y);
      gc.copyArea(image, buttonX * i, 0);
      images[i] = getImage(resourceManager, gray, image);
    }

    canvas.dispose();
    gc.dispose();
View Full Code Here

Examples of org.eclipse.swt.graphics.GC.copyArea()

      parentDir.mkdirs();
    try {
      log.debug(MessageFormat.format("Capturing screenshot ''{0}''", fileName)); //$NON-NLS-1$

      image = new Image(display, bounds.width, bounds.height);
      gc.copyArea(image, bounds.x, bounds.y);
      ImageLoader imageLoader = new ImageLoader();
      imageLoader.data = new ImageData[] { image.getImageData() };
      imageLoader.save(fileName, new ImageFormatConverter().imageTypeOf(fileName.substring(fileName.lastIndexOf('.') + 1)));
      return true;
    } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.swt.graphics.GC.copyArea()

      tmpParentShell.setSize(bounds.width, bounds.height);
      org.eclipse.swt.widgets.Canvas screenshotCanvas = new org.eclipse.swt.widgets.Canvas(tmpParentShell, SWT.NO_BACKGROUND);
      screenshotCanvas.setSize(bounds.width, bounds.height);
      GC displayGC = new GC(display);
      final Image screenshot = new Image(display, bounds.width, bounds.height);
      displayGC.copyArea(screenshot, location.x, location.y);
      displayGC.dispose();
      PaintListener paintListener = new PaintListener() {
        public void paintControl(PaintEvent e) {
          e.gc.drawImage(screenshot, 0, 0);
        }
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.