Examples of ImageData


Examples of org.eclipse.swt.graphics.ImageData

        int yoffset = (height - size) / 2;

        RGB black = new RGB(0, 0, 0);
        PaletteData dataPalette = new PaletteData(new RGB[] { black, black,
                color });
        ImageData data = new ImageData(width, height, 4, dataPalette);
        data.transparentPixel = 0;

        int end = size - 1;
        for (int y = 0; y < size; y++) {
            for (int x = 0; x < size; x++) {
                if (x == 0 || y == 0 || x == end || y == end) {
          data.setPixel(x + xoffset, y + yoffset, 1);
        } else {
          data.setPixel(x + xoffset, y + yoffset, 2);
        }
            }
        }

        return data;
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

        // XXX: Workaround for 1FMQ0P3: SWT:ALL - TableItem.setImage doesn't work if using the identical image."
        if (image != null) {
      image.dispose();
    }

        ImageData id = createColorImage(colorLabel.getParent().getParent(), rgb);
        ImageData mask = id.getTransparencyMask();
        image = new Image(colorLabel.getDisplay(), id, mask);
        colorLabel.setImage(image);

        rgbLabel
                .setText("(" + rgb.red + "," + rgb.green + "," + rgb.blue + ")");//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

      }
      int length = overlays.length;
      int x = 0;
      for (int i = 0; i < 3; i++) {
        if ((i < length) && (overlays[i] != null)) {
          ImageData id = overlays[i].getImageData();
          drawImage(id, x, getSize().y - id.height);
          x += id.width;
        }
      }
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

      }
      int length = overlays.length;
      int x = getSize().x;
      for (int i = 2; i >= 0; i--) {
        if ((i < length) && (overlays[i] != null)) {
          ImageData id = overlays[i].getImageData();
          x -= id.width;
          drawImage(id, x, getSize().y - id.height);
        }
      }
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

    /**
     * @see CompositeImageDescriptor#drawCompositeImage(int, int)
     */
    protected void drawCompositeImage(int width, int height) {
      ImageData bg;
      if ((fBase == null) || ((bg = fBase.getImageData()) == null)) {
        bg = DEFAULT_IMAGE_DATA;
      }
      drawImage(bg, 0, 0);

View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

      }
      int length = overlays.length;
      int x = 0;
      for (int i = 0; i < 3; i++) {
        if ((i < length) && (overlays[i] != null)) {
          ImageData id = overlays[i].getImageData();
          drawImage(id, x, 0);
          x += id.width;
        }
      }
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

      }
      int length = overlays.length;
      int x = getSize().x;
      for (int i = 2; i >= 0; i--) {
        if ((i < length) && (overlays[i] != null)) {
          ImageData id = overlays[i].getImageData();
          x -= id.width;
          drawImage(id, x, 0);
        }
      }
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

    resources.put(chip.getImagePath(size), icon);
    return icon;
  }
 
  private static Image getImageFromCollection(Image collectionImg, Point collectionDimensions, Point imageLocation) {
    ImageData data = collectionImg.getImageData();
    int srcX = data.width / collectionDimensions.x * (imageLocation.x - 1);
    int srcY = data.height / collectionDimensions.y * (imageLocation.y - 1);
    int srcWidth = data.width / collectionDimensions.x;
    int srcHeight = data.height / collectionDimensions.y;
    Image img = new Image(Display.getDefault(), srcWidth, srcHeight);
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

        this.size = new Point(baseImage.getBounds().width, baseImage.getBounds().height);
    }

    protected void drawCompositeImage(int width, int height) {
        drawImage(baseImage.getImageData(), 0, 0);
        ImageData overlayData = overlayImage.getImageData();
        // Use the missing descriptor if it is not there.
        if (overlayData == null) {
            overlayData = ImageDescriptor.getMissingImageDescriptor().getImageData();
        }
        drawImage(overlayData, 0, size.y - overlayData.height);
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

        {
            if ( newImageRawData != null )
            {
                try
                {
                    ImageData imageData = new ImageData( new ByteArrayInputStream( newImageRawData ) );
                    if ( imageData.type != requiredImageType )
                    {
                        ImageLoader imageLoader = new ImageLoader();
                        imageLoader.data = new ImageData[]
                            { imageData };
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.