-
Enhancement
-
Resolution: Fixed
-
P4
-
1.1
-
None
-
1.2alpha1
-
generic
-
solaris_2.5.1
-
Not verified
I am working with an ISV who needs to create two images on fly and
put one on top of the other one. Based on the information
that I have so far there is no way to create an object with
transparent background without going through the filtering in current
JDK1.1 release.
Apparently, the filtering process is very slow.
I have suggested the Lightweight components but that didn't work either.
I need to come up with a solution and cannot wait for Java 2D.
Thanks,
__Nasser
I tried the new Lightweight components in Java 1.1-beta3 since they have
transparent backgrounds. I found out the following:
- This new feature is designed mainly for UI components that are
put into Panels. All the examples have a panel that loads
a background image and then renders graphics from the
component onto the background image.
This feature does not seem to work that well with a Canvas
where I may be drawing multiple objects in an overlay fashion.
Note that my example already does the drawing of a background
image and then rendering above the image.
- I still had problems with createImage even when I used the
Lightweight
components. The createImage method is still creating images
in the background color. Thus, when I created a new image
in memory and drew it on the background image, the background
image was overwritten in places that I did not want that to
happen. Note that ImageFilters are not a solution since they
are extremely slow.
What I want is the following:
- a way to draw overlay images that the program generates onto a
background image without erasing the
background.
For example, I have an offscreen image and I create a grid
image that I want to draw over the offscreen image without
erasing the background.
- one solution is to have createImage make a transparent background.
- it must work on a Canvas object.
- it must be fast enough. ImageFilters are too slow.
put one on top of the other one. Based on the information
that I have so far there is no way to create an object with
transparent background without going through the filtering in current
JDK1.1 release.
Apparently, the filtering process is very slow.
I have suggested the Lightweight components but that didn't work either.
I need to come up with a solution and cannot wait for Java 2D.
Thanks,
__Nasser
I tried the new Lightweight components in Java 1.1-beta3 since they have
transparent backgrounds. I found out the following:
- This new feature is designed mainly for UI components that are
put into Panels. All the examples have a panel that loads
a background image and then renders graphics from the
component onto the background image.
This feature does not seem to work that well with a Canvas
where I may be drawing multiple objects in an overlay fashion.
Note that my example already does the drawing of a background
image and then rendering above the image.
- I still had problems with createImage even when I used the
Lightweight
components. The createImage method is still creating images
in the background color. Thus, when I created a new image
in memory and drew it on the background image, the background
image was overwritten in places that I did not want that to
happen. Note that ImageFilters are not a solution since they
are extremely slow.
What I want is the following:
- a way to draw overlay images that the program generates onto a
background image without erasing the
background.
For example, I have an offscreen image and I create a grid
image that I want to draw over the offscreen image without
erasing the background.
- one solution is to have createImage make a transparent background.
- it must work on a Canvas object.
- it must be fast enough. ImageFilters are too slow.