return;
}
if (!selected && (theme.isShowToolImageShadow() && GraphicsUtil.checkGdip())) {
ImageData shadowImage = image.getImageData();
PaletteData palette = new PaletteData(new RGB[] { new RGB(0, 0, 0), new RGB(154, 156, 146) });
ImageData data = new ImageData(shadowImage.width, shadowImage.height, 1, palette);
data.transparentPixel = shadowImage.transparentPixel;
if (shadowImage.getTransparencyType() == SWT.TRANSPARENCY_PIXEL) {
for (int pixelX = 0; pixelX < shadowImage.width; pixelX++) {
for (int pixelY = 0; pixelY < shadowImage.width; pixelY++) {
int dstPixel = shadowImage.getPixel(pixelX, pixelY);
if (dstPixel != shadowImage.transparentPixel) {
data.setPixel(pixelX, pixelY, 1);
} else {
data.setPixel(pixelX, pixelY, 0);
}
}
}
gc.setAdvanced(true);
Image tempImage = new Image(gc.getDevice(), data);
gc.drawImage(tempImage, x + 1, y + 1);
tempImage.dispose();
gc.setAdvanced(false);
gc.drawImage(image, x - 1, y - 1);
return;
}
gc.drawImage(image, x, y);
return;
}
if (!GraphicsUtil.checkGdip() || !theme.isShowToolImageShadow()) {
gc.drawImage(image, x, y);
return;
}
RGB[] rgbs = image.getImageData().palette.getRGBs();
if (rgbs == null) return;
for (int i = 0; i < rgbs.length; i++) {
RGB rgb = rgbs[i];
rgb.red = (rgb.red + 76) - (((rgb.red + 32) / 64) * 19);
rgb.green = (rgb.green + 76) - (((rgb.green + 32) / 64) * 19);
rgb.blue = (rgb.blue + 76) - (((rgb.blue + 32) / 64) * 19);
}
ImageData shadowImage = image.getImageData();
ImageData data = new ImageData(shadowImage.width,
shadowImage.height, shadowImage.depth, new PaletteData(rgbs));
data.transparentPixel = shadowImage.transparentPixel;
for (int pixelX = 0; pixelX < shadowImage.width; pixelX++) {
for (int pixelY = 0; pixelY < shadowImage.width; pixelY++) {
int dstPixel = shadowImage.getPixel(pixelX, pixelY);