JDK-6740278 : An image(256 colors) in clipboard should be displayed correctly
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-08-22
  • Updated: 2011-02-16
  • Resolved: 2009-02-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other Other Other JDK 6
1.4.2_19-revFixed 1.4.2_20-revFixed 1.4.2_21Fixed 5.0u19Fixed 6-poolResolved
Description
An image(256 colors) copied in clipboard is not displayed in Java program correctly.
Some right portion of orginal image moves to the left side and shows up in the Java application.

CONFIGURATION :
 JDK: 1.4.2/5.0u16/6.0u10
 OS : WindowsXP(SP2, Japanese)

REPRODUCE:
The following steps are for 6.0u10.
1) Open SwingSet3.png in "paint" tool of Windows Accesorries
2) Save the image as **256 colors bitmap***
3) [edit]-[select All] in paint tools window
4) [edit]-[Copy]
  (The image data is transferred to clipboard)
5) Compile the attached a.java
6) invoke "java a"

Please compare in the image in java application with the original one.
You can see the difference between both images.

Comments
EVALUATION The explanation of BITMAPINFOHEADER in Microsoft Platform SDK says, biClrUsed : --------------------------------------------------------------------- Specifies the number of color indexes in the color table that are actually used by the bitmap. If this value is zero, the bitmap uses the maximum number of colors corresponding to the value of the biBitCount member for the compression mode specified by biCompression. If biClrUsed is nonzero and the biBitCount member is less than 16, the biClrUsed member specifies the actual number of colors the graphics engine or device driver accesses. ... -------------------------------------------------------------------- The number of bits are 4bits and 8 bits for 16 colors and 256 colors respectively. ( 4 bits = 16 colors and 8bits = 256colors) However, 1 << (pSrcBmih->biBitCount - 1) seems 1 bit less shift distance.
06-11-2008