Anyone have a example for useing volitile image in exclusive mode with

i need a example of how to use a volitile image in exclusive mode with active rendering .
anyone know of one or even partial code of how to do it ive been racking my brain trying to figure out how to do it.
or even a example of fullscreen that i can use to draw to the screen in exclusive fullscreen mode.
and im not talking about the sun tutorial no one can even answer my question about it when i asked in the java forum

by the way, here's a commented version of the example I gave earlier in case the puzzle pieces are upside down for you...
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
/* Goes into FullScreen with 640x480 16 bit
* Not all proper checks are made (like getting available DisplayModes),
* But you can always look at the doc for the rest of the checks. Besides,
* What computer doesn't have 640x480...?
public class Example extends Frame implements Runnable, KeyListener {
     VolatileImage v;
     int w,h,x,size; // x and size are for the moving ball
     boolean done; // when this is true, the program exits
     public Example() {
          /* Sets up the frame to be used for fullscreen */
          super(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration());
          GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
          /* the below 2 methods aren't required
          * but using them results in best performance.*/
          setUndecorated(true);
          setIgnoreRepaint(true);
          /* A few mandatorial checks */
          if (device.isFullScreenSupported()) {
               device.setFullScreenWindow(this);
          if (device.isDisplayChangeSupported()) {
               device.setDisplayMode(new DisplayMode(640,480,16,0));
          /* our frame must be showing before we
          * we create our BufferStrategy or image,
          * in this case a VolatileImage.
          * Showing our frame also switches to
          * fullscreen mode.
          show();
          w = getSize().width;
          h = getSize().height;
          x = 0;
          size = 30;
          v = createVolatileImage(w,h); // creates volatile image (duh)
          done = false; // program exits when true
          addKeyListener(this); // used for exiting
          new Thread(this).start(); // starts the thread
     public void run() {
          while (!done) {
               x += 2; // increase ball location
               if (x >= w-size) x = 0; // back to left if all the way right
               /* You could also use repaint() here,
               * but you won't get a screen update
               * until the system decides it's time.
               * calling paint(getGraphics()) is much faster
               paint(getGraphics());
               /* Pausing of the thread... */
               try {
                    Thread.sleep(1);
               catch (InterruptedException e) {
                    done = true; // exit if there was some error
          System.exit(0); // this won't be called until done is true
     public void paint(Graphics g) {
          /* this attempts to get the graphics
          * from VolatileImage */
          Graphics gfx = v.getGraphics();
          /* If VolatileImage has no image memory,
          * we restore it and get the graphics for it */
          while (v.contentsLost()) {
               if (v.validate(getGraphicsConfiguration()) == VolatileImage.IMAGE_INCOMPATIBLE) {
                    v = createVolatileImage(w,h);
               gfx = v.createGraphics();
          /* this paints the ball etc */
          gfx.setColor(Color.black);
          gfx.fillRect(0,0,w,h);
          gfx.setColor(Color.cyan);
          gfx.fillOval(x,h/2-(size/2),size,size);
          g.drawImage(v,0,0,null); // draw the VolatileImage
     public void update(Graphics g) { // used for no blinking
          paint(g);
     public void keyPressed(KeyEvent e) {
          if (!done) done = true; // program exits on any key press
     public void keyReleased(KeyEvent e) {}
     public void keyTyped(KeyEvent e) {}
     public static void main(String[] args) {
          new Example();
}

Similar Messages

  • Does anyone have the code to use an image button as the reset button?

    Does anyone have the code to use an image button as the reset button? I'm finally at the end of the form and got the submit button to work as an image button, but cannot do the same with the reset button.  Any help is greatly appreciated!

    I agree. 
    http://www.456bereastreet.com/archive/200909/almost_never_add_a_reset_button_to_a_form/
    Nancy O.

  • Jaxa xml tutorials, does anyone have some tutorial for using xml in java??

    jaxa xml tutorials, does anyone have some tutorial for using xml in java??
    can be dom,sax,jaxp whatever....
    i try to find in google but din't find any complete one....

    dapim wrote:
    jaxa xml tutorials, does anyone have some tutorial for using xml in java??
    can be dom,sax,jaxp whatever....
    i try to find in google but din't find any complete one....I would imagine anyone here would just produce the same set of hits that you did, so why waste our time doing it only to direct you to the same one(s) you already found and rejected.

  • Does anyone have a solution for using my SIP phone with my MacBook Air

    I specifically purchased a MacAir for my home office. Small, Sleek, and portable. I just purchased a Cisco SIP phone and realized that I may have to continue to use my MacBook at my desk. Any work around? Is there some kind of hub or converter I can use? Thanks.

    Search the web or help doco about the Captivate feature called Return to Quiz.  It will do what you are looking for here according to your description.  There's even a Youtube video from a year or two back that shows how it works.

  • Does anyone have a recommendation for a portable name tag printer compatible with the iPad 2?

    I need to purchase one that will be compatible.

    I use brother printers for my company. they work great
    http://www.brother-usa.com/downloads/iphone-ipod-label-printing.aspx

  • Does anyone have any advice about using a QMS Magi Color 330 with up to date Mac

    I have just purchased on and want to hook it up, possibly on to wireless network so kids can blast away. could connect direct to Mac as well.

    I have just purchased on and want to hook it up, possibly on to wireless network so kids can blast away. could connect direct to Mac as well.

  • Does anyone have a fix for getting the facetime camera to work with Skype?

    I have been trying to skype with my daughter on my iMac, intel.  I've downloaded 7.0.02 ... the newest OS.  The camera will not work with Skype.  Any fixes yet, Apple?

    Have you posted this in Skype forums? 

  • Anyone have a source for the N93 updates?

    Now that nokia seems to have pulled support for N93 firmware updates, anyone have a source for them? Or am I stuck with the **bleep**tastic 10.0.025?Message Edited by kujako on 21-Nov-2006
    08:17 PM

    You'd be better trying your nearest Nokia Service Centre asking for the source is going to annoy people here... it's not publicly available.
    Nokia History: 3110, 5110, 7110, 7110, 3510i, 6210, 6310i, 5210, 6100, 6610, 7250, 7250i, 6650, 6230, 6230i, 6260, N70, N70, 5300, N95, N95, E71, E72
    Android History: HTC Desire, SE Xperia Arc, HTC Sensation, Sensation XE, One X+, Google Nexus 5

  • Using iMovie 09, when downloading video fromm Samsung HMX- H106SN, The video image is stretched. Anyone have an idea for a fix?

    Using iMovie 09, when downloading video from Samsung HMX- H106SN, the video image in iMovie is stretched. I see no obvious way to adjust this in iMovie.  When played on HDTV directly from camera using HDMI, the video image is fine.  Is this a compatibility issue? Anyone have an idea for a fix?
    Thnx, olive.c

    Thanks guys! Appreciate the help. Unfortunately I'm just not getting the same quality/file size/performance that I'm getting from the traditional Apple TV export option.
    I did however find what I think might even be a better solution for anyone using a mono wireless mic system like myself... use what's called a 3.5mm stereo jack to 3.5mm mono plug adapter. They're only like $5 and not only convert the audio so it comes out of both speakers, but this is probably a better option cause now in post production (iMovie) the other tracks like music etc... are still in stereo.
    Here's a link to the adapter on Tiger Direct... http://www.tigerdirect.com/applications/searchtools/item-Details.asp?EdpNo=93027 7&sku=C184-03174&srkey=3.5mm%20mono%20plug%20to%203.5mm%20stereo%20socket
    Hope this helps!
    Bryan

  • Updated to new 2014 cc. In bridge when I go to tools/Photoshop/Image Processor....I get this message "adobe photoshop 2014 CC has quit working" Anyone have a fix for this??

    updated to new 2014 cc. In bridge when I go to tools/Photoshop/Image Processor....I get this message "adobe photoshop 2014 CC has quit working" Anyone have a fix for this??

    I use a  windows 7 pro and have no problem like that from bridge cc when I select a thumbnail then use menu Tools>Photoshop>Image Processor..  I see Adobe Photoshop CC 2014 start up then I see the Image processor dialog and that one file is selected in the bridge I the complete the dialog and click run.  The image files are created. Photoshop remains open after the image files are create with no open documents. I need to click on the bridge in the task bar to bring bridge back into focus.
    What does you system configuration?

  • Does anyone have an example VI about how to call the animatewindow function in the user32.dll using CLN in Labview?

      I want to call the WinAPI function-animatewindow in user32.dll to produce some special effect when showing or hidding windows, but i don't know how to using this Win API to achieve my purpose?
      Does anyone have an example VI about this application?
      Thanks in advance for your help.

    You have to use the Call Library Function Node to call Windows API functions. The animatewindow function itself has some pretty simple parameters. You first need to get the window handle. There are a set of Windows API Function Utilities (32-bit) for LabVIEW that you can use. In there there is a VI (Get Window Refnum) that gets the window handle. It's a simple call to a Windows API function. You would call the animatewindow function in the same way. In this case there are 3 parameters: the window handle (returned by a FindWindow API call), a DWORD (32-bit integer) for the duration, and another DWORD for the flags.

  • Does anyone have an example code to use mx:ViewStack with my application.

    Does anyone have an example code to use <mx:ViewStack>
    with my application.
    I don't know about how to put value to it and use value in
    it.

    http://livedocs.adobe.com/flex/2/langref/mx/containers/ViewStack.html#includeExamplesSumma ry
    That should be what you're looking for.

  • Does anyone have any suggestions for Ad blocking? I'm getting a lot of pop up ads while using Facebook from Safari.

           I'm getting a lot of pop up ads. mostly while using  Facebook. I'm running Safari on a Macbook Pro running Yosemite. Does anyone have any suggestions for an Ad blocker. I don't see anything in the App store.
          I can't swear to it but I don't recall this being a problem pre-Yosemite. I could be wrong. I haven't been real active on Facebook until recently. I see some third party apps out there but am alway wary of non approved software.
         Thanks
         Ron

    You may have installed the "VSearch" trojan. Remove it as follows.
    Malware is always changing to get around the defenses against it. These instructions are valid as of now, as far as I know. They won't necessarily be valid in the future. Anyone finding this comment a few days or more after it was posted should look for more recent discussions or start a new one.
    Back up all data before proceeding.
    Step 1
    From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Extensions
    Uninstall any extensions you don't know you need, including any that have the word "Spigot," "Trovi," or "Conduit" in the description. If in doubt, uninstall all extensions. Do the equivalent for the Firefox and Chrome browsers, if you use either of those.
    Reset the home page and default search engine in all the browsers, if it was changed.
    Step 2
    Triple-click anywhere in the line below on this page to select it:
    /Library/LaunchAgents/com.vsearch.agent.plist
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item named "com.vsearch.agent.plist" selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
    Repeat with each of these lines:
    /Library/LaunchDaemons/com.vsearch.daemon.plist
    /Library/LaunchDaemons/com.vsearch.helper.plist
    Restart the computer and empty the Trash. Then delete the following items in the same way:
    /Library/Application Support/VSearch
    /System/Library/Frameworks/VSearch.framework
    ~/Library/Internet Plug-Ins/ConduitNPAPIPlugin.plugin
    Some of these items may be absent, in which case you'll get a message that the file can't be found. Skip that item and go on to the next one.
    The problem may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow.
    You may be wondering why you didn't get a warning from Gatekeeper about installing software from an unknown developer, as you should have. The reason is that the Internet criminal behind VSearch has a codesigning certificate issued by Apple, which causes Gatekeeper to give the installer a pass. Apple could revoke the certificate, but as of this writing has not done so, even though it's aware of the problem. This failure of oversight has compromised both Gatekeeper and the Developer ID program. You can't rely on Gatekeeper alone to protect you from harmful software.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • I am using photoshop cc 2014.2 And when I use save for Web it gives me a dialog box that says it is using Latin characters I've never seen this before. Does anyone have an answer for this problem or do I need to go back to the older version of Photoshop.

    I'm using Photoshop cc 2014.21 I you save for Web and dialog box comes up that says that Photoshop is using Latin characters and that servers cannot recognize Latin characters in webpages and you may have trouble viewing these pages does anyone have an answer for this problem?

    What Firefox version is currently installed on the computer?
    You can find the full version of the current current Firefox release (37.0.2) in all languages and all operating systems here:
    *https://www.mozilla.org/en-US/firefox/all/
    If you have a very old Firefox version then you could consider to uninstall that version to clean up existing registry keys (especial the uninstall key).
    Make sure NOT to remove "personal data" when you uninstall Firefox, because that will remove all profile folders and you lose personal data like bookmarks and passwords including data in profiles created by other Firefox versions.
    Check the Firefox program folder and remove the Firefox program folder if there are still files left in it.
    *(32 bit Windows) "C:\Program Files\Mozilla Firefox\"
    *(64 bit Windows) "C:\Program Files (x86)\Mozilla Firefox\"
    It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    *http://kb.mozillazine.org/Uninstalling_Firefox
    Your bookmarks and other personal data are stored in the Firefox profile folder and won't be affected by an uninstall and (re)install, but make sure NOT to remove personal data when you uninstall Firefox as that will remove all Firefox profile folders and you lose your personal data.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Profile_backup
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • Does anyone have a suggestion for an app for recording phone calls that is reliable and easy to use?

    does anyone have a suggestion for recording iphone4s calls that is reliable and easy to use

    There are no such apps that work. Doing so would require routing the call through a 3rd party service.

Maybe you are looking for