How to reduce flicking in animation?

Answers were Sorted based on User's Feedback



How to reduce flicking in animation?..

Answer / m!r@

Double Buffering

sample code of java to reduce flinking :

public void update(Graphics g) {
Graphics offgc;
Image offscreen = null;
Dimension d = size();
offscreen = createImage(d.width, d.height);
offgc = offscreen.getGraphics();
offgc.setColor(getBackground());
offgc.fillRect(0, 0, d.width, d.height);
offgc.setColor(getForeground());
paint(offgc);
g.drawImage(offscreen, 0, 0, this);

}

Is This Answer Correct ?    1 Yes 0 No

How to reduce flicking in animation?..

Answer / tarush1988

double buffering

Is This Answer Correct ?    0 Yes 0 No

How to reduce flicking in animation?..

Answer / m. abhishek

By using offGra first draw whole animated image on a blank
Image and put this image directly on the screen

so at the time of animation the each movement of image can
draw
in other image and put this Image to screen.

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Core Java Interview Questions

What do you understand by an io stream?

0 Answers  


What is a top level class in java?

0 Answers  


Hi Friends, I am beginner in java. what i know about synchonized keyword is,If more that one 1 thread tries to access a particular resource we can lock the method using synchronized keyword. Then after that how the lock is released and how next thread access that.Please explain with example.

5 Answers  


Why do we use threads in java?

0 Answers  


What are synchronized methods and synchronized statements in java programming?

0 Answers  






What class is used to implement a Throwable array?

3 Answers  


what is meant by string pooling?

12 Answers   Oracle, Polaris, Tribal Fusion, Wipro,


What are the advantages of unicode?

0 Answers  


Why Java is not purely object oriented?

50 Answers   Elitecore, Persistent, Reliance, Wipro,


What are JVM.JRE, J2EE, JNI?

0 Answers  


What do you mean by jjs in java8?

0 Answers  


How to convert String into primitive datatype.

6 Answers  


Categories