mouatts
asked on
Image flicker
I have written an applet that does banner rotation. The only thing is that the banners flicker, as though they are being redrawn by clearing to the background first. It doesn't matter whether the banner is animated of not and it is not occuring at the point when the banner image is changed.
My paint method looks as follows
public void paint(Graphics g)
{
Image image=getImage(u[current_i mage]);
g.drawImage(image,0,0,this );
}
Just to make sure I used Mediatracker to ensure the image was loaded, but this had no effect.
Any clues how I can overcome this?
My paint method looks as follows
public void paint(Graphics g)
{
Image image=getImage(u[current_i
g.drawImage(image,0,0,this
}
Just to make sure I used Mediatracker to ensure the image was loaded, but this had no effect.
Any clues how I can overcome this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For the sake of the value of the PAQ's, it would be nice if you mentioned what the wrinkle was.
If you dislike questions being "locked" (which does not in fact prevent anyone from adding comments), you could mention that in the question or reject the answer.
The guideline for answers below notes that an answer should be "a specific solution to a question ... [that] will solve the questioner's problem and doesn't duplicate a previous comment".
The answer I gave obviously did not duplicate a comment, and it was my conviction that it would solve your problem. There is always the possibilty that I am wrong, of course, which is why you have access to the "reject answer" button.
If you dislike questions being "locked" (which does not in fact prevent anyone from adding comments), you could mention that in the question or reject the answer.
The guideline for answers below notes that an answer should be "a specific solution to a question ... [that] will solve the questioner's problem and doesn't duplicate a previous comment".
The answer I gave obviously did not duplicate a comment, and it was my conviction that it would solve your problem. There is always the possibilty that I am wrong, of course, which is why you have access to the "reject answer" button.
P.S. there is an extensive debate on the topic of answers and comments at: https://www.experts-exchange.com/questions/20304200/Answer-Button-Input-and-Ideas.html .
ASKER
You've been on EE long enough to know that locking questions is frowned on by the vast majority of members.
The wrinkle is of course dealing with the situation when you do want to repaint the background. The answer of course being to use super.update(g) on those occasions.
The wrinkle is of course dealing with the situation when you do want to repaint the background. The answer of course being to use super.update(g) on those occasions.
ASKER