Package org.eclipse.swt.graphics

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


              nsImage});
      // Create the result image
      Image image = new Image(Display.getCurrent(), width, 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

              new Integer(0)});
      // Create the result image
      Image image = new Image(Display.getCurrent(), width, 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

              new Integer(0)});
      // Create the result image
      Image image = new Image(Display.getCurrent(), width, 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

      // 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

              new Integer(0)});
      // Create the result image
      Image image = new Image(Display.getCurrent(), width, 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

    addEndRect(endRect);
   
    // Capture the background image   
    backingStore = new Image(theShell.getDisplay(), psRect);
    GC gc = new GC(display);
      gc.copyArea(backingStore, psRect.x, psRect.y);
    gc.dispose();
   
    theShell.setBackgroundImage(backingStore);
    theShell.setVisible(true);
    display.update();
View Full Code Here

      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

      // 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

     */
    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

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.