I used the GWTCanvas to achieve PNG transparency so that I could
overlay an image over another and see through it.
String[] urls;
// clear the canvas
canvas.clear();
// draw the shape of the work piece with background
ShapeVO shape = controller.getSelectedShape();
urls = new String[2];
urls[0] = SSConstants.IMAGE_SERVICE_STRING + "?"
+ SSConstants.IMAGE_KEY_STRING + "=" + shape.getIconImageKey();
urls[1] = SSConstants.IMAGE_SERVICE_STRING + "?"
+ SSConstants.IMAGE_KEY_STRING + "=" +
shape.getImageKey();
ImageLoader.loadImages(urls, new ImageLoader.CallBack() {
public void onImagesLoaded(ImageElement[]
imageElements) {
canvas.saveContext();
canvas.translate(CANVAS_X_CENTER,
CANVAS_Y_CENTER);
ImageElement imageBackground = null;
for (ImageElement image : imageElements) {
if (imageBackground == null) {
imageBackground = image;
} else {
double imageHeight =
-(image.getHeight() / 2);
double imageWidth =
-(image.getWidth() / 2);
canvas.drawImage(imageBackground, imageWidth,
imageHeight,
image.getWidth(), image.getHeight());
canvas.drawImage(image,
imageWidth,
imageHeight);
}
}
canvas.restoreContext();
}
});
On Oct 8, 9:36 pm, Mike wrote:
> I am using thecompositemethods mentioned above, but the transparency
> of my PNG is not honored. I have tried running the code both on my
> Windows dev machine and also on the google servers with the same
> results.
>
> Any workarounds or is this a known problem?
>
> Thanks,
>
> Mike
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=.