aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2014-05-14 09:48:59 (EDT)
committerArun Thondapu2014-05-14 09:55:08 (EDT)
commit23a4ae5a01c03d1e89c88b45ce6a00f7b7cfc803 (patch)
tree0018d6fdf9fbf7d34013ee81df76ced1f2497f59
parent2958e16615b4d5e0811266d64a0c720c35a392bf (diff)
downloadeclipse.platform.swt-23a4ae5a01c03d1e89c88b45ce6a00f7b7cfc803.zip
eclipse.platform.swt-23a4ae5a01c03d1e89c88b45ce6a00f7b7cfc803.tar.gz
eclipse.platform.swt-23a4ae5a01c03d1e89c88b45ce6a00f7b7cfc803.tar.bz2
shown as black box in Eclipse Change-Id: I71dd783809878e9fb55c1a4ba56723fff7a900fc Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/ImageList.java24
1 files changed, 22 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/ImageList.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/ImageList.java
index 87f7b27..6f31c07 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/ImageList.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/ImageList.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -405,7 +405,27 @@ void set (int index, Image image, int count) {
ImageData data = image.getImageData ();
switch (data.getTransparencyType ()) {
case SWT.TRANSPARENCY_ALPHA:
- if (OS.COMCTL32_MAJOR >= 6) {
+ /*
+ * Fully transparent image is rendered as a black image, so such
+ * image needs to be rendered using ImageData mask approach.
+ * Refer bug 426247
+ *
+ * TODO: Explore using createMaskFromAlpha() method even
+ * for newer versions of the COMCTL32 library.
+ */
+ boolean fullyTransparent = true;
+ if (data.alphaData == null) {
+ fullyTransparent = false;
+ }
+ else {
+ for (byte alphaData : data.alphaData) {
+ if (alphaData != 0) {
+ fullyTransparent = false;
+ break;
+ }
+ }
+ }
+ if (OS.COMCTL32_MAJOR >= 6 && !fullyTransparent) {
hBitmap = copyWithAlpha (hImage, -1, data.alphaData, cx [0], cy [0]);
} else {
hBitmap = copyBitmap (hImage, cx [0], cy [0]);