Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.ImageData


                try{
                    icon.paintIcon(null, g, 0, 0);
                }finally{
                    g.dispose();
                }
                ImageData data = createImageData(image);
                return data;
            }
           
        };
        return descriptor;
View Full Code Here


      addTopRightImage(DeeImages.DESC_OVR_CONST, topRightPoint);
    }
   
    if(elementDesc.isFlag(DefElementFlagConstants.FLAG_TEMPLATED)) {
      int x = 0;
      ImageData data = getImageData(DeeImages.DESC_OVR_TEMPLATED);
      drawImage(data, x, 0);
    }
   
    if(elementDesc.getArcheType() == EArcheType.Alias) {
      int x = 0;
      ImageData data = getImageData(DeeImages.DESC_OVR_ALIAS);
      drawImage(data, x, getSize().y - data.height);
    }
   
  }
View Full Code Here

      }
    }

    // destBytesPerLine is used as scanlinePad to ensure that no padding is
    // required
    return new ImageData(srcData.width, srcData.height, srcData.depth,
        srcData.palette, destBytesPerLine, newData);
  }
View Full Code Here

      }
    }
   
    // destBytesPerLine is used as scanlinePad to ensure that no padding is
    // required
    return new ImageData(width, height, srcData.depth, srcData.palette,
        destBytesPerLine, newData);
  }
View Full Code Here

import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.widgets.Display;

public class Helper {
public static Image readImage(Display display, String filename) {
  ImageData imgData = new ImageData(locateFile(filename));
  return new Image(display, imgData);
}
View Full Code Here

    int height= size.y;

    if (fgPaletteData == null)
      fgPaletteData= createPalette(display);

    ImageData imageData= new ImageData(width, height, 1, fgPaletteData);

    for (int y= 0; y < height; y++)
      for (int x= 0; x < width; x++)
        imageData.setPixel(x, y, (x + y) % 2);

    return new Image(display, imageData);
  }
View Full Code Here

    PaletteData caretPalette= new PaletteData(new RGB[] {new RGB (0,0,0), new RGB (255,255,255)});
    int width= getCaretWidthPreference();
    int widthOffset= width - 1;
   
    // XXX: Filed request to get a caret with auto-height: https://bugs.eclipse.org/bugs/show_bug.cgi?id=118612   
    ImageData imageData= new ImageData(4 + widthOffset, styledText.getLineHeight(), 1, caretPalette);

    Display display= styledText.getDisplay();
    Image bracketImage= new Image(display, imageData);
    GC gc= new GC (bracketImage);
    gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
View Full Code Here

    if (image == null)
      return image;

    // create custom image
    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);

      int xo= Math.max(0, (SIZE - data.width) / 2);
      int yo= Math.max(0, (SIZE - data.height) / 2);

      for (int y= 0; y < SIZE; y++) {
        for (int x= 0; x < SIZE; x++) {
          if (y >= yo && x >= xo && y < yo + data.height && x < xo + data.width) {
            resized.setPixel(x, y, data.getPixel(x - xo, y - yo));
            resizedMask.setPixel(x, y, mask.getPixel(x - xo, y - yo));
          }
        }
      }

      copy= new Image(Display.getCurrent(), resized, resizedMask);
View Full Code Here

            }
    }
   
    public void hRotate(final Image from, final Image to, final GC gc, final boolean toRight) {
        isAnyTransitionInProgress = true;
        final ImageData fromData = from.getImageData();
       
        //Thread thread = new Thread(new Runnable() {
        //    public void run() {
       
        double dx = 0;
        double a = 1;
        double time = 0;
        double dy = fromData.height * dx / fromData.width;
        double destHeight = 0;
        int h = from.getImageData().height;
        int w = from.getImageData().width;
       
        Image im = new Image(Display.getCurrent(), fromData.width, fromData.height);
        GC imgc = new GC(im);
        imgc.setBackground(backgroundColor);
        imgc.fillRectangle(0, 0, fromData.width, fromData.height);
        if( null != backgroundImage ) {
            ImageData imgData = backgroundImage.getImageData();
            imgc.drawImage(backgroundImage, 0, 0, imgData.width, imgData.height, 0, 0, w, h);
        }
        imgc.dispose();
       
        Image tmp = new Image(Display.getCurrent(), fromData.width, fromData.height);
View Full Code Here

        isAnyTransitionInProgress = false;
    }

    public void vRotate(final Image from, final Image to, final GC gc, final boolean toRight) {
        isAnyTransitionInProgress = true;
        final ImageData fromData = from.getImageData();
       
        //Thread thread = new Thread(new Runnable() {
        //    public void run() {
       
        double dy = 0;
        double a = 1;
        double time = 0;
        double dx = fromData.width * dy / fromData.height;
        double destWidth = 0;
        int h = from.getImageData().height;
        int w = from.getImageData().width;
       
        Image im = new Image(Display.getCurrent(), fromData.width, fromData.height);
        GC imgc = new GC(im);
        imgc.setBackground(backgroundColor);
        imgc.fillRectangle(0, 0, fromData.width, fromData.height);
        if( null != backgroundImage ) {
            ImageData imgData = backgroundImage.getImageData();
            imgc.drawImage(backgroundImage, 0, 0, imgData.width, imgData.height, 0, 0, w, h);
        }
        imgc.dispose();
       
        Image tmp = new Image(Display.getCurrent(), fromData.width, fromData.height);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.ImageData

Copyright © 2018 www.massapicom. 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.