Package org.eclipse.swt.graphics

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


    _coordinateSystem.setOrigin(new Position(m.getNorth(), m.getWest()));
    _coordinateSystem.setDx(new Vector2d(m.getEast().diff(m.getWest()) / w, 0));
    _coordinateSystem.setDy(new Vector2d(0, m.getSouth().diff(m.getNorth()) / h));

    ImageData id = (ImageData) imageData.clone();
    id = id.scaledTo(w, h);
    for (int y = 0; y < h; y++) {
      final Vector2d p = (Vector2d) p0.clone();
      for (int x = 0; x < w; x++) {
        try {
          final int pixel = imageData.getPixel((int) Math.round(p.getX()), (int) Math
View Full Code Here

            {
                ImageData imageData = img.getImageData();
                if (tileset != null && tileset.getTransparentColor() != null) {
                  imageData.transparentPixel = imageData.palette.getPixel(tileset.getTransparentColor());
                }
        scaledImage = new Image(Display.getDefault(), imageData.scaledTo((int) Math.round(bounds.width * zoom), (int) Math.round(bounds.height * zoom)));
                       

//                MediaTracker mediaTracker = new MediaTracker(new Canvas());
//                mediaTracker.addImage(scaledImage, 0);
//                try {
View Full Code Here

      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

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.