Using GraphicsContext on Textures ?

Hi,

is there any way to draw on existing textures using the normal graphics context from java.awt (rendering into a BufferedImage) ?

I want to draw text and whatever on textures this way.
Under OpenGL it was possible to update the full or parts of a texture using the:
GLupdateSubTexture(c->qi.texture,x,y,width,height,remoteBuffer);
function.

any ideas or hints would be nice :slight_smile:

Ca$cade

I don’t have the API docs with me but I beleave you can grab an ImageComponent2D from the texture, get a bufferedimage from the ImageComponent2D, draw on it and set the modified image back into the ImageComponent2D…

There are performance downsides, I think by modifiying the image it dirties the cached image in the video card etc.

An example
You can manipulate the return image at will.

Texture2D texture = getTexture2D(“some.gif”);
ImageComponent2D d3 = null;
d3 = (ImageComponent2D) texture.getImage(0);

img = d3.getImage();

Thanks a lot, I will try it out … :slight_smile: