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

When can you say a graph to be a tree?

0 Answers   Amazon,


can u give one sinario when you use Abstract Class and When you use Interface.

5 Answers   ITC Infotech,


What is the difference between overriding & overloading?

0 Answers  


How to create a custom exception?

0 Answers  


Is passing by reference faster?

0 Answers  






How we can run a jar file through command prompt in java?

0 Answers  


what are the oops concept in java explain with real time examples

24 Answers   Accenture, Bosch, Consummate Technologies, CTS, Current Technologies, iNautix, Infosys, Kekran Mekran, QA InfoTech, RTRT, SofTech, Tech Mahindra, Thorogood, Timios, Wipro,


What is methodological framework?

0 Answers  


How many boolean functions are there?

0 Answers  


What is meant by local variable and instance variable?

0 Answers  


how to print a numbers from 1 to 100 with out using control structures?

4 Answers   IBM,


What is a method in coding?

0 Answers  


Categories