Package com.ctreber.aclib.image.ico

Examples of com.ctreber.aclib.image.ico.BitmapDescriptor


   * @param y
   *          Height
   * @return Icon that fits best
   */
  private Image getBestIcon(ICOFile ico, int x, int y) {
    BitmapDescriptor entry = null;

    int curwidth = Integer.MAX_VALUE;
    int curheight = Integer.MAX_VALUE;
    int curdepth = 0;

    List<BitmapDescriptor> descriptors = ico.getDescriptors();
    for (BitmapDescriptor desc : descriptors) {
      if (Math.abs(x - curwidth) >= Math.abs(x - desc.getWidth())
          && Math.abs(y - curheight) >= Math.abs(y - desc.getHeight())
          && desc.getBPP() > curdepth) {
        entry = desc;
      }

    }

    return entry.getImageRGB();
  }
View Full Code Here

TOP

Related Classes of com.ctreber.aclib.image.ico.BitmapDescriptor

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.