How Lavatron Works Java Help

How Lavatron Works

Lavatron is able to present an interesting image onscrccn because of a small trick that it employs, and its side effect allows the applct io load very quickly. The reason it loads so quickly is that there isn’t much data transmitted over the Net. The source image is a JPEG image that is 64 times smaller than (he displayed image. Each pixel in the source image is scaled up to an 8×8-pixcl square. Here is the trick that Lavatron uses to produce the lightbulb effect. An 8×8-pixcl jruage of a transparent circle surrounded by a black bezel,  a white highlight for a dash of style, is painted over the scaled-up color pixel. As an optimization, the bulbs are preassernblcd into an image that can be painted once for each column. shows what the bulb mask looks like blown up. The two white pixels are the highlight. The black pixels in U:lC corner arc 0p’lque. Finally, all of the gray pixels in the middle are transparent, to allow the lightbulb color to show through. Lavatron paints so fast because it doesn’t have to repaint what it has already drawn. The technique of copying the area of the screen that’s good and painting just the portion that’s new is used in many common operations involving scrolling. TIle awl.Graphics functloncepyAreal ) takes a portion of an image defined by a rectangle and moves it by an x,y offset from its starting location, As a graphics speed optimization, copyArca() is hard to beat. It consistently outperforms any other technique of image rendering, such as the use of drawlma e(), or drawlmage() through a cl.ipRect( ). Building an image much larger than your applet, which has several source images concatenated into a single image, and then using copy/vrca to move them into place and clipping the result onscrecn is a vpry fast Java rendering technique.

JavaHelpOnline.com

  • Feel free to send us an inquiry, we will reply back in hours.
 

Verification

Posted on September 18, 2014 in The Lavatron Applet A Speirts Arena Display

Share the Story

About the Author

Back to Top
Share This