Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.ImageLoader.load()


    if (bytes != null && bytes.length > 0) {
      ByteArrayInputStream inS = null;
      try {
        inS = new ByteArrayInputStream(bytes);
        ImageLoader loader = new ImageLoader();
        ImageData[] imageDatas = loader.load(inS);

        /* Look for the Icon with the best quality */
        if (imageDatas != null)
          imgData = getBestQuality(imageDatas, wHint, hHint);
      } catch (SWTException e) {
View Full Code Here


      try {
        if (Application.IS_LINUX) //Use native loading on Linux to support alpha in ICO
          return new Image(device, fFaviconFile.toString());

        ImageLoader loader = new ImageLoader();
        ImageData[] datas = loader.load(fFaviconFile.toString());
        if (datas != null && datas.length > 0)
          return new Image(device, datas[0]);
      } catch (SWTException e) {
        //Fallback to alternative method to load Image
      } catch (SWTError error) {
View Full Code Here

    if (bytes != null && bytes.length > 0) {
      ByteArrayInputStream inS = null;
      try {
        inS = new ByteArrayInputStream(bytes);
        ImageLoader loader = new ImageLoader();
        ImageData[] imageDatas = loader.load(inS);

        /* Look for the Icon with the best quality */
        if (imageDatas != null)
          imgData = getBestQuality(imageDatas, wHint, hHint);
      } catch (SWTException e) {
View Full Code Here

    if (bytes != null && bytes.length > 0) {
      ByteArrayInputStream inS = null;
      try {
        inS = new ByteArrayInputStream(bytes);
        ImageLoader loader = new ImageLoader();
        ImageData[] imageDatas = loader.load(inS);

        /* Look for the Icon with the best quality */
        if (imageDatas != null)
          imgData = getBestQuality(imageDatas);
      } catch (SWTException e) {
View Full Code Here

    public static void main(String[] args) throws Exception {
    }

    public static void makeImageTransparent(String imagePath) throws FileNotFoundException {
        ImageLoader imageLoader = new ImageLoader();
        imageLoader.load(new FileInputStream(imagePath));
        int whitePixel = imageLoader.data[0].palette.getPixel(new RGB(255,255,255));
        for (int i = 0; i < imageLoader.data.length; i++) {
            imageLoader.data[i].transparentPixel = whitePixel;
        }
        imageLoader.save(imagePath + ".tr.gif", SWT.IMAGE_GIF);
View Full Code Here

//        BufferedImage bi = ImageIO.read(imageURL.openStream());
//       
//        ImageIO.write(bi, "jpg", file);

        ImageLoader loader = new ImageLoader();
        loader.load( imageURL.openStream() );
       
        Image image  = new Image( Display.getCurrent(), loader.data[0] );
 
        if (card instanceof CardTemplateAdapter) {
          CardTemplateAdapter adapter = (CardTemplateAdapter) card;
View Full Code Here

    if (bytes != null && bytes.length > 0) {
      ByteArrayInputStream inS = null;
      try {
        inS = new ByteArrayInputStream(bytes);
        ImageLoader loader = new ImageLoader();
        ImageData[] imageDatas = loader.load(inS);

        /* Look for the Icon with the best quality */
        if (imageDatas != null)
          imgData = getBestQuality(imageDatas, wHint, hHint);
      } catch (SWTException e) {
View Full Code Here

      try {
        if (Application.IS_LINUX) //Use native loading on Linux to support alpha in ICO
          return new Image(device, fFaviconFile.toString());

        ImageLoader loader = new ImageLoader();
        ImageData[] datas = loader.load(fFaviconFile.toString());
        if (datas != null && datas.length > 0)
          return new Image(device, datas[0]);
      } catch (SWTException e) {
        //Fallback to alternative method to load Image
      } catch (SWTError error) {
View Full Code Here

  public GUI(Sudoku sudoku) {
    // Get the main monitor
    Monitor monitor = display.getPrimaryMonitor();

    ImageLoader loader = new ImageLoader();
    ImageData data = loader.load("images/Logo.png")[0];
    Image image = new Image(display, data);
    shell.setImage(image);

    // Customize the shell
    GridLayout layout = noMarginGridLayout(1, true, 16);
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.