<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    On 3/22/2016 8:36 AM, Hendrik Schreiber wrote:<br>
    <blockquote
      cite="mid:1D2830BA-9610-407B-9C4C-424E6B57074D@tagtraum.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <br class="">
      <div apple-content-edited="true" class="">
      </div>
      <br class="">
      <div>
        <blockquote type="cite" class="">
          <div class="">On Mar 21, 2016, at 22:07, Alexandr Scherbatiy
            <<a moz-do-not-send="true"
              href="mailto:alexandr.scherbatiy@oracle.com" class="">alexandr.scherbatiy@oracle.com</a>>
            wrote:</div>
          <br class="Apple-interchange-newline">
          <div class="">
            <meta content="text/html; charset=windows-1252"
              http-equiv="Content-Type" class="">
            <div bgcolor="#FFFFFF" text="#000000" class=""> On 3/18/2016
              6:09 AM, Hendrik Schreiber wrote:<br class="">
              <blockquote
                cite="mid:337E07D9-EC25-4BE7-B387-F11473A8BB26@tagtraum.com"
                type="cite" class="">
                <meta http-equiv="Content-Type" content="text/html;
                  charset=windows-1252" class="">
                On Mar 16, 2016, at 06:25, Alexandr Scherbatiy <<a
                  moz-do-not-send="true"
                  class="moz-txt-link-abbreviated"
                  href="mailto:alexandr.scherbatiy@oracle.com"><a class="moz-txt-link-abbreviated" href="mailto:alexandr.scherbatiy@oracle.com">alexandr.scherbatiy@oracle.com</a></a>>

                wrote:<br class="">
                <div class="">
                  <blockquote type="cite" class=""><br
                      class="Apple-interchange-newline">
                    <div class="">
                      <meta content="text/html; charset=windows-1252"
                        http-equiv="Content-Type" class="">
                      <div bgcolor="#FFFFFF" text="#000000" class=""> <br
                          class="">
                          The JDK fixes should be pushed to the JDK 9
                        first and then be back-ported to JDK 8.<br
                          class="">
                        <br class="">
                          Could you prepare the fix for JDK 9?<br
                          class="">
                      </div>
                    </div>
                  </blockquote>
                  <div class=""><br class="">
                  </div>
                  <div class="">Hi Alexandr,</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">I've created a patch for JDK9. You can
                    find it at <a moz-do-not-send="true"
                      class="moz-txt-link-freetext"
                      href="http://cr.openjdk.java.net/%7Ehschreiber/8151385/webrev.00/">http://cr.openjdk.java.net/~hschreiber/8151385/webrev.00/</a> (I

                    hope, I created the webrev the right way). It
                    contains a suitable test.</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">This patch also contains the changes I
                    suggested in <a moz-do-not-send="true"
                      class="moz-txt-link-freetext"
                      href="https://bugs.openjdk.java.net/browse/JDK-8149453">https://bugs.openjdk.java.net/browse/JDK-8149453</a> (because

                    the fixes overlap to a degree). I made sure they
                    compile, but didn’t do any further testing (lack of
                    time). Perhaps, since you are already working on
                    this, you can try it out and, if you deem it
                    appropriate, add a test for the upFolder/newFolder
                    etc. buttons.</div>
                </div>
              </blockquote>
                 For some reasons the native getIconBits() method
              returns size 16 for both small and large icons which leads
              to the AOBE in the BufferedImage.setRGB() methods.<br
                class="">
                 I will try to investigate it deeper.<br class="">
            </div>
          </div>
        </blockquote>
        <div><br class="">
        </div>
      </div>
    </blockquote>
    I got the IOBE running the simple JFileChooser (new
    JFileChooser().showOpenDialog(null));<br>
    <br>
    I created an application in Visual Studio and try to check the
    returned icon size.<br>
    It returns the same size 16 for both IDB_VIEW_SMALL_COLOR and
    IDB_VIEW_LARGE_COLOR.<br>
    <br>
    Here is the code which I used (without any error handling):<br>
    ----------------<br>
        WPARAM size = (WPARAM)IDB_VIEW_LARGE_COLOR;<br>
    <br>
        int iconIndex = VIEW_NEWFOLDER;<br>
        HWND hWndToolbar = ::CreateWindowEx(0, TOOLBARCLASSNAME, NULL,<br>
            0, 0, 0, 0, 0,<br>
            NULL, NULL, NULL, NULL);<br>
        SendMessage(hWndToolbar, TB_LOADIMAGES, size,
    (LPARAM)HINST_COMMCTRL);<br>
        HIMAGELIST hImageList = (HIMAGELIST)SendMessage(hWndToolbar,
    TB_GETIMAGELIST, 0, 0);<br>
        <br>
        HICON hIcon = ImageList_GetIcon(hImageList, iconIndex,
    ILD_TRANSPARENT);<br>
    <br>
        BITMAP bmp;<br>
        memset(&bmp, 0, sizeof(BITMAP));<br>
    <br>
        ICONINFO iconInfo;<br>
        GetIconInfo((HICON)hIcon, &iconInfo);<br>
        HDC dc = GetDC(NULL);<br>
        GetObject(iconInfo.hbmColor, sizeof(bmp), &bmp);<br>
    <br>
        TCHAR     str[MAX_LOADSTRING];<br>
        wsprintf(str, L"Icon size: [%d, %d]", bmp.bmWidth,
    bmp.bmHeight);<br>
        MessageBox(NULL, str, L"TEST", MB_OK);<br>
    ----------------<br>
    <br>
     The other thing that I noticed that icons on JOptionPane have twice
    bigger size than expected.<br>
    <br>
    Thanks,<br>
    Alexandr.<br>
    <blockquote
      cite="mid:1D2830BA-9610-407B-9C4C-424E6B57074D@tagtraum.com"
      type="cite">
      <div>
        <div>Thanks.</div>
      </div>
      <br class="">
      <div class="">-hendrik</div>
    </blockquote>
    <br>
  </body>
</html>