Examples of scaledTo()


Examples of org.eclipse.swt.graphics.ImageData.scaledTo()

   
    ImageData image_data = program.getImageData();
    if (image_data == null) {
      return getImage("image_not_found.png");
    }
    image_data = image_data.scaledTo(16, 16);
    Image image = new Image(SWTThread.getDisplay(),image_data);
    return image;
  }
 
  public static Image getMenuImage(String name) {
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData.scaledTo()

      if (imageFile == null)
        return;

      /* Scale if required */
      if (imgData.width != 16 || imgData.height != 16)
        imgData = imgData.scaledTo(16, 16);

      /* Try using native Image Format */
      try {
        if (storeImage(imgData, imageFile, imgData.type))
          return;
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData.scaledTo()

              } else {
                sizeX = cSize.y * currentImage.getWidth() / currentImage.getHeight();
                newX = (cSize.x - sizeX) / 2;
              }
            }
            imgdata = imgdata.scaledTo(sizeX, sizeY);
          }

          if (alpha != event.gc.getAlpha()) {
            event.gc.setAlpha(alpha);
          }
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData.scaledTo()

    if (imgData != null) {
      File imageFile = getImageFile(id);

      /* Scale if required */
      if (imgData.width != 16 || imgData.height != 16)
        imgData = imgData.scaledTo(16, 16);

      /* Try using native Image Format */
      try {
        if (storeImage(imgData, imageFile, imgData.type))
          return;
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData.scaledTo()

    if (imgData != null) {
      File imageFile = getImageFile(id);

      /* Scale if required */
      if (imgData.width != 16 || imgData.height != 16)
        imgData = imgData.scaledTo(16, 16);

      /* Try using native Image Format */
      try {
        if (storeImage(imgData, imageFile, imgData.type))
          return;
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData.scaledTo()

    final int SIZE= 16; // square images
    ImageData data= image.getImageData();
    Image copy;
    if (data.height > SIZE || data.width > SIZE) {
      // scale down to icon size
      copy= new Image(Display.getCurrent(), data.scaledTo(SIZE, SIZE));
    } else {
      // don't scale up, but rather copy into the middle and mark everything else transparent
      ImageData mask= data.getTransparencyMask();
      ImageData resized= new ImageData(SIZE, SIZE, data.depth, data.palette);
      ImageData resizedMask= new ImageData(SIZE, SIZE, mask.depth, mask.palette);
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData.scaledTo()

            {
            nHeight = size;
            nWidth = (size * width) / height;
            }

          iconData = iconData.scaledTo(nWidth, nHeight);
          }

        int x0 = (size - width) / 2;
        int y0 = (size - height) / 2;

View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData.scaledTo()

        thumbHeight = _thumbSize;
        thumbWidth = (_thumbSize * _width) / _height;
        }

      //      PaletteData pdt = fullImg.palette;
      _thumb = fullImg.scaledTo(thumbWidth, thumbHeight);

      // Get new date
      File f = new File(dirname + File.separator + filename);
      _lmd = f.lastModified();
      _lmDate = null;
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData.scaledTo()

          {
          nHeight = _fbprm.iconSize;
          nWidth = (_fbprm.iconSize * id.width) / id.height;
          }

        id = id.scaledTo(nWidth, nHeight);
        }
      else
        {
        nWidth = id.width;
        nHeight = id.height;
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData.scaledTo()

            {
            nHeight = size;
            nWidth = (size * width) / height;
            }

          iconData = iconData.scaledTo(nWidth, nHeight);
          }

        int x0 = (size - width) / 2;
        int y0 = (size - height) / 2;

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.