hi Magnus,
a couple of years ago I rewrote an old Basic program in Java. That program was about a lot of cirkels
growing in size and melting into one another. I did that by constantly changing the color palette . That
was very easy to do in that Basic. In this topic:
https://coderanch.com/t/652409/GUI/java/Circle-Oval-increase-size-timer#3015749
you can see what I was after, although in that demo the cirkels do overlap.
In Java, it was much harder. The only way I managed was by using BufferedImages of
TYPE_BYTE_INDEXED and a suitable colormodel. Unfortunately, it looks like the colormodel
of a BI is immutable. So, to get the effect of palette changes, I needed to create multiple BI's.
Have a look at the following demo.
In this demo, I create a normal type_argb BI, and I draw filled cirkels into it. Then I create
a BI of type byte_indexed, with 1 bit per pixel, and two colors: a transparant color and a
second color. Next I draw my normal argb_BI into it, forcing all the colored pixels to get a
pixel value of 1 in my byte_indexed BI.
After that, I constantly create a new BI, again type_indexed, only with the color that I want,
and I copy the raster of my current indexed BI into this. Then I paint this new index BI into my panel.
I guess this sounds a lot more complex than it is. You could do the same, by creating a
type_byte_indexed BI, the same size as your font-image, and then following the strategy that I used.
Is there any particular reason why you write strings in this very complex way?
Here is the demo code.
Greetz,
Piet