Exemplo n.º 1
0
  public DeviceBMP(File image) {
    this.image = image;
    try {
      imgBytes = Base.loadBytesRaw(image);
    } catch (Exception e) {
    }
    name = image.getName();
    width =
        (imgBytes[21] << 24) & 0xFF
            | (imgBytes[20] << 16) & 0xFF
            | (imgBytes[19] << 8) & 0xFF
            | (imgBytes[18] << 0) & 0xFF;

    height =
        (imgBytes[25] << 24) & 0xFF
            | (imgBytes[24] << 16) & 0xFF
            | (imgBytes[23] << 8) & 0xFF
            | (imgBytes[22] << 0) & 0xFF;
  }