I've been playing around with graphics for some time now but since last week I've been getting some weird things happening to transparent images.

When the processor is at hard work (or if I use a bad one) the transparent image flickers to a none transparent image every now and then. I'm using normal images from java.util.Image to render them onto a Graphics class (by extending my class to a JPanel and overriding the paintComponent method and using g.drawImage). I've tried converting the Graphics into a Graphics2D but it didn't help (no idea why it would but I tried). But just rendering a single transparent image doesn't make it flicker but when a lot of process gets into the program it starts. But I can't seem to recreate it in a smaller project in one single class.

If you know the answer or have seen it before, please reply to this thread.

Thanks in advance!

10-30-2013, 03:34 PM

jim829

Re: Transparent Image flickers to none transparent image

Can you provide an SSCCE that demonstrates the problem (even if it is processor dependent). You may also want to investigate modifying rendering hints and/or using clip regions to help minimize the amount of repainting.

Regards,
Jim

10-30-2013, 04:07 PM

totalspelnerd

Re: Transparent Image flickers to none transparent image

Okay, I've found a solution. I did something wrong with my own library that renders images on layers. Apparently it is saving the transparent images or rendering them twice sometimes. Probably something to do with painting Threads. I've found a way to come around this problem now. I'm feeling kinda stupid for asking for help right now. Sorry for wasting your time on nothing.

10-30-2013, 05:06 PM

gimbal2

Re: Transparent Image flickers to none transparent image

Lesson learned: don't call stuff weird. It will never ever help you to label things as strange or weird; that's just misdirection for admitting that you don't understand it (yet). If you label it truthfully ("I DON'T UNDERSTAND IT YET!") the next step is simple: attempt to understand it first!