Improving performance via buffered image

Hi,
I'm new-ish to java2D and have a question on improving the performance of my not massively graphics intensive app.
Basically at the moment I do all my drawing by subclassing a JPanel, overriding the paintComponent()method and drawing straight to the graphics object passed in.
my question is is this a sound approach? would I get better performance by creating a buffered image, doing my updates to that and THEN updating the actual display in one hit using it? any other performance tips?
Thanks in advance.
p.s. has anyone had any big performance nasties happening when drawing graphics on multi-monitor displays? or is it justt me?

Is the performance satisfactory? Perhaps you're just curious, or perhaps you are unhappy with performance...
Are you refreshing your display often -- several times a second -- or only occassionally?
Is your paintComponent method expensive? Are you doing number crunching of you own there,
or are you doing a lot of graphics work -- thousands of cubic parametric curves, say?
There is no one-size-fits-all solution to rendering performance, so you are going to have to be more specific,
if you want the help you get here to be relevant.

Similar Messages

  • How do I fix extremely slow rendering with buffered images?

    I've found random examples of people with this problem, but I can't seem to find any solutions in my googling. So I figured I'd go to the source. Basically, I am working on a simple platform game in java (an applet) as a surprise present for my girlfriend. The mechanics work fine, and are actually really fast, but the graphics are AWFUL. I wanted to capture some oldschool flavor, so I want to render several backgrounds scrolling in paralax (the closest background scrolls faster than far backgrounds). All I did was take a buffered image and create a graphics context for it. I pass that graphics context through several functions, drawing the background, the distant paralax, the player/entities, particles, and finally close paralax.
    Only problem is it runs at like 5 fps (estimated, I havn't actually counted).
    I KNOW this is a graphics thing, because I can make it run quite smoothly by commenting out the code to draw the background/paralax backgrounds... and that code is nothing more complicated than a graphics2d.drawImage
    So obviously I am doing something wrong here... how do I speed this up?
    Code for main class follows:
    import javax.swing.JApplet;
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import java.awt.event.*;
    import Entities.*;
    import Worlds.*;
    // run this applet in 640x480
    public class Orkz extends JApplet implements Runnable, KeyListener
         double x_pos = 10;
         double y_pos = 400;
         int xRes=640;
         int yRes=480;
         boolean up_held;
         boolean down_held;
         boolean left_held;
         boolean right_held;
         boolean jump_held;
         Player player;
         World world;
         BufferedImage buffer;
         Graphics2D bufferG2D;
         int radius = 20;
         public void init()
              //xRes=(int) this.getSize().getWidth();
              //yRes=(int) this.getSize().getHeight();
            buffer=new BufferedImage(xRes, yRes, BufferedImage.TYPE_INT_RGB);
            bufferG2D=buffer.createGraphics();
              addKeyListener(this);
         public void start ()
                player=new Player(320, 240, xRes,yRes);
                world=new WorldOne(player, getCodeBase(), xRes, yRes);
                player.setWorld(world);
               // define a new thread
               Thread th = new Thread (this);
               // start this thread
               th.start ();
         public void keyPressed(KeyEvent e)
              //works fine
         }//end public void keypressed
         public void keyReleased(KeyEvent e)
              //this works fine
         public void keyTyped(KeyEvent e)
         public void paint( Graphics g )
               update( g );
        public void update(Graphics g)
             Graphics2D g2 = (Graphics2D)g;              
             world.render(bufferG2D);                
             g2.drawImage(buffer, null, null);
         public void run()
              // lower ThreadPriority
              Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
              long tm;
              long tm2;
              long tm3;
              long tmAhead=0;
              // run a long while (true) this means in our case "always"
              while (true)
                   tm = System.currentTimeMillis();
                   player.moveEntity();
                  x_pos=player.getXPos();
                  y_pos=player.getYPos();
                  tm2 = System.currentTimeMillis();
                    if ((tm2-tm)<20)
                     // repaint the applet
                     repaint();
                    else
                         System.out.println("Skipped draw");
                    tm3= System.currentTimeMillis();
                    tmAhead=25-(tm3-tm);
                    try
                        if (tmAhead>0) 
                         // Stop thread for 20 milliseconds
                          Thread.sleep (tmAhead);
                          tmAhead=0;
                        else
                             System.out.println("Behind");
                    catch (InterruptedException ex)
                          System.out.println("Exception");
                    // set ThreadPriority to maximum value
                    Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
         public void stop() { }
         public void destroy() { }
    }Here's the code for the first level
    package Worlds;
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.image.BufferedImage;
    import java.util.*;
    import javax.swing.*;
    import javax.imageio.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.io.File;
    import java.net.URL;
    import java.awt.geom.AffineTransform;
    import Entities.Player;
    public class WorldOne implements World
         Player player;
         //Location of Applet
         URL codeBase;
         // Image Resources
         BufferedImage paralax1Image;
         BufferedImage paralax2Image;
         BufferedImage backgroundImage;
         // Graphics Elements     
         int xRes;
         int yRes;
         double paralaxScale1,paralaxScale2;
         double worldSize;
         int frameX=1;
         int frameY=1;
         public WorldOne(Player player, URL codeBase, int xRes, int yRes)
              this.player=player;
              this.codeBase=codeBase;
              this.xRes=xRes;
              this.yRes=yRes;
              worldSize=4000;
            String backgroundImagePath="worlds\\world1Graphics\\WorldOneBack.png";
            String paralax1ImagePath="worlds\\world1Graphics\\WorldOnePara1.png";
            String paralax2ImagePath="worlds\\world1Graphics\\WorldOnePara2.png";
            try
            URL url1 = new URL(codeBase, backgroundImagePath);
             URL url2 = new URL(codeBase, paralax1ImagePath);
             URL url3 = new URL(codeBase, paralax2ImagePath);
            backgroundImage = ImageIO.read(url1);
            paralax1Image  = ImageIO.read(url2);
            paralax2Image = ImageIO.read(url3);
            paralaxScale1=(paralax1Image.getWidth()-xRes)/worldSize;
            paralaxScale2=(paralax2Image.getWidth()-xRes)/worldSize;
            catch (Exception e)
                 System.out.println("Failed to load Background Images in Scene");
                 System.out.println("Background Image Path:"+backgroundImagePath);
                 System.out.println("Background Image Path:"+paralax1ImagePath);
                 System.out.println("Background Image Path:"+paralax2ImagePath);
         }//end constructor
         public double getWorldSize()
              double xPos=player.getXPos();
              return worldSize;
         public void setFramePos(int frameX, int frameY)
              this.frameX=frameX;
              this.frameY=frameY;
         public int getFrameXPos()
              return frameX;
         public int getFrameYPos()
              return frameY;
         public void paralax1Render(Graphics2D renderSpace)
              int scaledFrame=(int)(paralaxScale1*frameX);
              renderSpace.drawImage(paralax1Image,-scaledFrame,0,null); //Comment this to increase performance Massively
         public void paralax2Render(Graphics2D renderSpace)
              int scaledFrame=(int)(paralaxScale2*frameX);
              renderSpace.drawImage(paralax2Image,-scaledFrame,0,null); //Comment this to increase performance Massively
         public void backgroundRender(Graphics2D renderSpace)
              renderSpace.drawImage(backgroundImage,null,null); //Comment this to increase performance Massively
         public void entityRender(Graphics2D renderSpace)
              //System.out.println(frameX);
              double xPos=player.getXPos()-frameX+xRes/2;
             double yPos=player.getYPos();
             int radius=15;
             renderSpace.setColor (Color.blue);
            // paint a filled colored circle
             renderSpace.fillOval ((int)xPos - radius, (int)yPos - radius, 2 * radius, 2 * radius);
              renderSpace.setColor(Color.blue);
         public void particleRender(Graphics2D renderSpace)
              //NYI
         public void render(Graphics2D renderSpace)
              backgroundRender(renderSpace);
              paralax2Render(renderSpace);
              entityRender(renderSpace);
              paralax1Render(renderSpace);
    }//end class WorldOneI can post more of the code if people need clarification. And to emphasize, if I take off the calls to display the background images (the 3 lines where you do this are noted), it works just fine, so this is purely a graphical slowdown, not anything else.
    Edited by: CthulhuChild on Oct 27, 2008 10:04 PM

    are the parallax images translucent by any chance? The most efficient way to draw images with transparent areas is to do something like this:
         public static BufferedImage optimizeImage(BufferedImage img)
              GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();                    
              GraphicsConfiguration gc = gd.getDefaultConfiguration();
              boolean istransparent = img.getColorModel().hasAlpha();
              BufferedImage img2 = gc.createCompatibleImage(img.getWidth(), img.getHeight(), istransparent ? Transparency.BITMASK : Transparency.OPAQUE);
              Graphics2D g = img2.createGraphics();
              g.drawImage(img, 0, 0, null);
              g.dispose();
              return img2;
         }I copied this from a util class I have and I had to modify it a little, I hope I didn't break anything.
    This piece of code does a number of things:
    - it allows the images to be hardware accelerated
    - the returned image is 100% compatible with the display, regardless of what the input image is
    - BITMASK transparent images are an incredible amount faster than translucent images
    BITMASK means that a pixel is either fully transparent or it is fully opaque; there is no alpha blending being performed. Alpha blending in software rendering mode is very slow, so this may be the bottleneck that is bothering you.
    If you require your parallax images to be translucent then I wouldn't know how to get it to draw quicker in an applet, other than trying out java 6 update 10 to see if it fixes things.

  • I have a MAC Pro from 2011 currently running MAC OS 10.9.5.  This weekend I cloned the MAC HD drive to a new SSD drive for improved performance.  The clone was completed successfully with no errors.  After the clone completed I successfull restarted my sy

    I have a MAC Pro from 2011 currently running MAC OS 10.9.5.  This weekend I cloned the MAC HD drive to a new SSD drive for improved performance.  The clone was completed successfully with no errors.  After the clone completed I successfully restarted my system using the SSD as the boot device.  I then successfully tested all of my products, including Photoshop CS6 and all of its plug-ins.  I successfully tested the key features that I frequently use.  Today while attempting to launch Photoshop CS6 a message is being displayed indicating that a scratch disk cannot be found.  All drives are available on the system via the Finder and Disk Utility.  I can access all drives including the old MAC HD which is no longer the boot device.  I've even attempted to launch Photoshop from the old device yet the same error persist.  Is there a way to review/edit/change Photoshop preferences if Photoshop doesn't launch?  I've even restarted my system several times to see if that would resolve the issues.  Does anyone have any recommendations for this issue?  Have you previously address this issue? 
    Thank you Gregg Williams

    Boilerplate text:
    Reset Preferences
    http://forums.adobe.com/thread/375776
    1) Close the program and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (not reversible)
    or
    2) Move the Folder. See:
    http://www.bugge.com/Family-and-friends/Illy/illy.html
    --OB

  • Java Grahpics2d, Buffered Image, really bad fps when rotating a image10Dpts

    Hey, i'm making a spaceship game, and i use buffered .gif that are loaded before they are used.
    (The images are only loaded once before anyone says that :D )
    However, when i have a reasonably sized image rotating in real time, such as a 533 by 182, at normal scale my fps drops really low, like into the mid teens, and i'm not sure why.
    This only seems to happen when the iamge rotates, the fps stays fine when the image is translating.
    I use Affine Transforms to do my rotating.
    And i'm already using the createCompatibleImage GraphicsConfiguration to help increase performance, but i still get this problem.
    I've also noticed if i zoom in realy close (using scaling ffrom affine transform) the same thing happens if i rotate, and my fps drops really low as well.
    and the problem with the fps dropping when rotating is alot reduced if i zoom out alot as well.
    Anyone got any idea how i can imrpove performance.
    I'm buffering images as so:
         public BufferedImage createCompatible(int width, int height, int transparency) {
              GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration() ;
              BufferedImage compatible = gc.createCompatibleImage(width,height,transparency);
              return compatible;
         }and the following code block is the one i use to render the spaceships (Actors)
         public void paint(Graphics2D g){
                   AffineTransform at = new AffineTransform();
              at.scale(Sector42Main.UNIVSCALE, Sector42Main.UNIVSCALE);
              at.translate(x
                        -(((Actor)Sector42Main.playeractors.get(FOCUS_ID)).x)
                        +((Stage.WIDTH/2)/Sector42Main.UNIVSCALE)
                        - (((Actor)Sector42Main.playeractors.get(FOCUS_ID)).getWidth()/2) ,
                        y
                        -(((Actor)Sector42Main.playeractors.get(FOCUS_ID)).y)
                        + ((Stage.HEIGHT/2)/Sector42Main.UNIVSCALE)
                        - (((Actor)Sector42Main.playeractors.get(FOCUS_ID)).getHeight()/2));
              at.rotate(r,getWidth()/2,getHeight()/2);
         at.scale(xscale, yscale);
              g.drawImage( spriteCache.getSprite(spriteNames[currentFrame]),at, stage);
         }any help would be really welcome.
    thanks.
    Message was edited by:
    MatthewH

    I've found that a lot of game development seems to involve working out exactly what you can get away with in terms of display rather than conforming to a strict model. Sure, this is changing these days, but in terms of a bitmapped sprite just how much difference will each incremement make when projected onto pixels?
    I tend to find a little experimentation with these things goes a long way - you might find that rounding your model's angle to a display angle with a much lower resolution (say, every 2 or 5 or 10 degrees) doesn't acutally make any real difference to the game (apart from letting you render frames moire quickly) once a number of sprites are flying about the place.
    Still, just one suggestion. Let us all know if you find a another way around it.
    Cheers,
    John

  • Improving Performance between WRT610N (v1) and WET610N (v1)

    Any advice on how to improve performance of the connection between these two Wireless N devices?
    WRT610N (v1) and WET610N (v1)
    We have a PS3 connected to the WET610N via Ethernet directly, and it connects the PS3 communication wirelessly to the Internet through the WRT610N.  Just wondering if there are some known tweaks that will improve performance between them.  One thing I think is ridiculous is that the WRT610N is showing only 30% signal strength on the WET610N.  That is ridiculous as they are not far from eachother.
    Any input is welcome!

    Whats the Distance between your Router and the Bridge? Are you connected to 5GHz wireless network or 2.4GHz wireless network?  Whats the Wireless Settings you have setup on your Router.

  • Brush Lag? - Here are OpenGL settings that improve performance

    For anyone having horrible Brush lag, please try the following settings and report your findings in this thread.
    After much configuring and comparing CS4 vs CS3, I found that these settings do improve CS4's brush lag significantly. CS3 is still faster, but these settings made CS4 brush strokes a lot more responsive.
    Please try these settings and share your experiences.
    NOTE: these do not improve clone tool performance, the best way to improve clone performance right now seems to be to turn off the clone tools overlay feature.
    Perhaps Adam or Chris from Adobe could explain what is happening here. The most significant option that improved performance appears to be the "Use for Image Display - OFF". I have no idea what this feature does or does not do but it does seem to be the biggest performance hit. The next most influential setting seems to be "3D Interaction Acceleration - OFF"
    Set the following settings in Photoshop CS4 Preferences:
    OpenGL - ON
    Vsync - OFF
    3D Interaction Acceleration - OFF
    Force Bilinear Interpolation - OFF
    Advanced Drawing - ON
    Use for Image Display - OFF
    Color Matching - ON

    Hi guys,
    As I am having very little problems with my system I though I should post my specs and settings for comparison reasons.
    System - Asus p5Q deluxe,
    Intel quad 9650 3ghz,
    16gb pc6400 800Mhz ram,
    loads of drives ( system drive on 10K 74gb Raptor, Vista partition on fast 500gb drive, Ps scratch on an another fast 500gb drive, the rest are storage/bk-ups ),
    Gainward 8800GTS 640mb GPU,
    30ins monitor @2560x1600 and a 24ins 1920x1200,
    Wacom tablet.
    PS CS4 x64bit
    Vista x64
    All latest drivers
    No Antivirus. Index and superfetch is ON, Defender is ON
    No internet connection except for updates
    No faffing around with vista processes
    Wacom Virtual HID and Wacom Mouse Monitor are disabled
    nVidia GPU set to default settings
    On this system I am able to produce massive images, the last major size was 150x600cm@200ppi and the brushes are smooth until they increased to around 700+ pixels then there is a slight lag of around 1 second if I draw fast, if I take it slow then there's no lag. All UI is snappy.
    I have the following settings in Photoshop CS4 Preferences:
    Actual Ram: 14710MB
    Set to use (87%) :12790MB
    Scratch Disk
    on a separate fast 500gb - to become a 80gb ssd soon
    History state: 50
    Cache: 8
    OpenGL - ON
    Vsync - OFF
    3D Interaction Acceleration - OFF
    Force Bilinear Interpolation - OFF
    Advanced Drawing - ON
    Use for Image Display - ON
    Color Matching - ON
    I hope this helps in some way too...
    EDIT: I should also add that I Defrag all my drives with a third party defrag software every night due to the large image files.

  • Improving performance when using LineStripArray?

    I'm rendering approximately 680 LineStripArrays to represent an airport on a situation display. I read the data from a DXF file and I imagine I can strip that down by removing parts of the airport I don't want to show.
    However, performance is poor - I'm probably hitting 50fps when I'm barely rendering anything. Apart from not displaying some LineStripArrays, what can I do to improve performance? Should I merge some LineStripArrays? Is there another geometry class I should use?
    My code is:
                   // This array will hold the vertices.
                   float[] vertices = new float[count*3];
                   // Create the colour.
                   Color3f colour = new Color3f(1.0f,1.0f, 1.0f);
                   // iterate over all vertex of the polyline
                   for (int i = 0; i < count; i++) {                    
                        vertices[(i*3)+0] = (float)vertex.getX();
                        vertices[(i*3)+1] = (float)vertex.getY();
                        vertices[(i*3)+2] = (float)vertex.getZ();
                   }And then:
    layerData = new LineStripArray(count, LineArray.COORDINATES, strip_counts);
    layerData.setCoordinates(0, vertices);Thanks
    Edited by: BobCrivens on Sep 18, 2008 7:39 AM

    Yes, it will cause performance issues.  Whether you notice it or not may be a different story.
    LabVIEW drawing engine starts at the bottom layer and works its way up.  So, it has to redraw the image and then redraw the control when you update the control/indicator.
    It's been a while since I benchmarked this on a project, but in LabVIEW 6.1, I looked into why my tests ran so slow, and saw a 10-15% decrease in test time by removing the background decorations I used to make the window pretty.  If I didn't show the GUI feedback for the test at all (no GUI windows for each test), I saw a 30% decrease in test time.
    You will also find that better video cards will have a positive effect on this, as they redraw the screen faster.  In the same benchmark, I was able to outperform the early PXI controllers with a slower PC because NI was using a lower end video chip for their onboard graphics.

  • External drives to improve performance?

    I have a 17" macbook pro, 8gb RAM, Ati Radeon 6750, Intel i7 2,2ghz
    I want to work with final cut pro X and motion 5, but i see that there´s no scratch disk preferences inside these applications.
    Working with an external hard drive could improve performance? What if i only have usb 2.0 by the moment?
    should be better to work on the macbook hard drive till I can get a usb 3.0 or thunderbolt in the future?
    Thanks,
    Pablo

    Stick with FW800 external drives.  No, there's no more Scratch Disk (thank goodness).  Inside FCP X, you create Events on any hard drive attached.  You create Projects on any hard drive attached.  You can even use Disk Images, too.  The user manual explains all of this very clearly.
    I'd stay away from USB for video editing all together.  Thunderbolt will help with really large projects, and work using very high end, very large HD and digital film files.

  • Super Proxy? Improve Performance more?

    http://help.adobe.com/en_US/AfterEffects/9.0/WSF13D6BED-C53B-408a-B2D6-C8B4205D4FB7a.html
    Outside of these Adobe tips on improving performance, does anyone know any more tricks? ....even if its a third party purchase. It just seemed that when proxied everything, the machine still hangs up enough to annoy me and images because theyre proxied/lowres are of course a bit blurry. I guess Im hoping there is some super proxy plug-in that lets you work superfast. The dream is to build HD 3D animations on a laptop. Then ftp it all to a renderfarm and they do the heavy lifting and mail me a nice shiny bluray.

    Mylenium,  Could you please give a guy a hand as I'm loosing my mind calling first level support at adobe.  A run down on basic performance setting would be helpful. 
    Should I be looking at a Mac?
    I just posted my workstation specs and I also have the same system and work.  Dell t7400
    We are seeing the CPU getting hammered while doing a simple AE task.  Just a png file with a blur effect kills the system.
    What could be going on.  Do I need to PRAY!!!
    Max

  • Apple TV Update / Improved Performance

    I have noted that since the recent update to both the ATV and iTunes overall performance has measurably improved. For example, when scrolling through lists of films the associated metadata - artwork and comments / descriptions - appear faster on-screen and just seem to be snappier. I stream my whole library from a 1TB USB external drive via Airport Extreme...
    I hope to find that the overall stability of the ATV is improved as well.
    Good work to date Apple...The ATV continues to follow an upward trend with regard to performance and reliability. I hope other forum users have noted these improvements...
    Best Wishes,
    RPM

    Apple may not have promised any improved performance; that does not necessarily prove no performance improvements exist. It is not unreasonable to think there is a synergy between the latest iTunes / ATV software that addressed technical issues separately and created better performance collectively. Fact - free that we are here, perhaps anecdotal evidence - as I have provided - as well as having some time pass to determine if the ATV requires less rebuilding / rebooting will best tell the tale...
    Bst Wishes,
    RPM

  • FI-CA events to improve performance

    Hello experts,
    Does anybody use the FI-CA events to improve the extraction performance for datasources 0FC_OP_01 and 0FC_CI_01 (open and cleared items)?
    It seems that this specific exits associated to BW events have been developped especially to improve performance.
    Any documentation, guide should be appreciate.
    Thanks.
    Thibaud.

    Thanks to all for the replies
    @Sybrand
    Please answer first whether the column is stored in a separate lobsegment.
    No. Table,Index,LOB,LOB index uses the same TS. I missed adding this point( moving to separate TS) as part of table modifications.
    @Hemant
    There's a famous paper / blog post about CLOBs and Database Flashback. If I find it, I'll post the URL.
    Is this the one you are referring to
    http://laimisnd.wordpress.com/2011/03/25/lobs-and-flashback-database-performance/
    By moving the CLOB column to different block size , I will test the performance improvement it gives and will share the results.
    We dont need any data from this table. XML file contains details about finger prints and once the application server completes the job , XML data is deleted from this table.
    So no need of backup/recovery operations for this table. Client will be able to replay the transactions if any problem occurs.
    @Billy
    We are not performing XML parsing on DB side. Gets the XML data from client -> insert into table -> client selects from table -> Upon successful completion of the Job from client ,XML data gets deleted.
    Regarding binding of LOB from client side, will check on that side also to reduce round trips.
    By changing the blocksize, I can keep db_32K_cache_size=2G and keep this table in CACHE. If I directly put my table to CACHE, it will age out all other operation from buffer which makes things worse for us.
    This insert is part of transaction( Registration of a finger print) and this is the only statement taking time as of now compared to other statements in the transaction.
    Thanks,
    Arun

  • How to preload sound into memory to improve performance?

    Hello all
    I have an application where it needs to play 4 different short wave files on some events. The wave files are small (less then 1 sec each) so they can be preloaded into memory. But I don't really know how to do that.. This is my current code... Performance is really important here, so the faster users can hear the sounds, the better...
    import java.io.*;
    import javax.sound.sampled.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class PlaySound implements ActionListener
         private Clip clip = null;
         public void play(String name)
              if (clip != null)
                   clip.stop();
                   clip = null;
              loadClip(name);
              clip.start();
         private void loadClip(String fnm)
              try
                   AudioInputStream stream = AudioSystem.getAudioInputStream(new File(fnm + ".wav"));
                   AudioFormat format = stream.getFormat();
                   DataLine.Info info = new DataLine.Info(Clip.class, format);
                   if (!AudioSystem.isLineSupported(info))
                        JOptionPane.showMessageDialog(null, "Unsupported sound line", "Warning!", JOptionPane.WARNING_MESSAGE);
                   else
                        clip = (Clip) AudioSystem.getLine(info);
                        clip.open(stream);
                        stream.close();
              catch (Exception e)
                   JOptionPane.showMessageDialog(null, "loadClip E: " + e.toString(), "Warning!", JOptionPane.WARNING_MESSAGE);
         public static void main(String[] args)
              play("a wav file name");
    }     I would appreciate it if someone can point out how I can preload them to improve performance... Thanks in advance!

    The message above should be:
    OMG, me dumb you smart Florian...
    Thank you for your suggestion... It's not the best OR anything close to what I thought it would be, it's certainly one way to do it and better then what I've got now...
    Thanks again Florian, I really appreciate it!!
    BTW, is there anything that would produce the sound faster then this?
    Message was edited by:
    BuggyVB

  • How to improve performance of MediaPlayer?

    I tried to use the MediaPlayer with a On2 VP6 flv movie.
    Showing a video with a resolution of 1024x768 works.
    Showing a video with a resolution of 1280x720 and a average bitrate of 1700 kb/s leads to a delay of the video signal behind the audio signal of a couple of seconds. VLC, Media Player Classic and a couple of other players have no problem with the video. Only the FX MediaPlayer shows a poor performance.
    Additionally mouse events in a second stage (the first stage is used for the video) are not processed in 2 of 3 cases. If the MediaPlayer is switched off, the mouse events work reliable.
    Does somebody know a solution for this problems?
    Cheers
    masim

    duplicate thread..
    How to improve performance of attached query

  • How to improve performance when there are many TextBlocks in ItemsControl items?

       Hi,
       I'm trying to find a way to improve performance for a situation when there is an ItemsControl using UI and Data virtualization and each item on that control has 36 TextBlocks. Basically the item is a single string. There are so many TextBlocks
    to allow assigning different brushes to different parts of the string. Performance of this construction is terrible. I have 37 items visible on the screen and if I try to scroll up or down it scrolls into the black space and then it takes a second or two to
    show the items.
       I tried different things. For example, the most successful performance-wise was to replace TextBlocks with Borders and then draw bitmaps. In other words, I prepared 127 bitmaps for each character (I need ASCII only) and then I used those bitmaps
    to set Border.Backgrounds. It improved performance about 1.5 - 2 times but it consumed much more memory (which is not surprising, of course). Required amount of memory is so big that it throws OutOfMemoryException on 512MB emulator but works on 1GB. As a result
    I don't thing it is a good solution.
       Another thing that worked perfect is to replace 36 TextBlocks with only 6 TextBlocks. In this case the performance improvement is about 5 - 10 times but I lose the ability to set different colors to different parts of the string. It seems that
    the performance degrades dramatically with the increase of number of TextBlocks. Is there another technique to draw strings where literally each character can be of different color with decent performance?
    Thank you
    Alex

       Using Runs inside TextBlocks gives approximately the same improvement as using bitmaps 1.5 - 2 times faster but it is not even close to the case with just a couple of TextBlocks in the ItemsControl item. Any other ideas?
    Alex

  • How to improve Performance of the Statements.

    Hi,
    I am using Oracle 10g. My problem is when i am Execute & fetch the records from the database it is taking so much time. I have created Statistics also but no use. Now what i have to do to improve the Performance of the SELECT, INSERT, UPDATE, DELETE Statements.
    Is it make any differents because i am using WindowsXP, 1 GB RAM in Server Machine, and WindowsXP, 512 GB RAM in Client Machine.
    Pls. Give me advice for me to improve Performance.
    Thank u...!

    What and where to change parameters and values ?Well, maybe my previous post was not clear enough, but if you want to keep your job, you shouldn't change anything else on init parameter and you shouldn't fall in the Compulsive Tuning Disorder.
    Everyone who advise you to change some parameters to some value without any more info shouldn't be listen.
    Nicolas.

Maybe you are looking for

  • How to use Custom resource in MSA 5.0

    Hi All, I need to create a Custom resource on a tileset, where i need to create a hyperlink with an image. On clicking this image(hyperlink) , the control should transfer to the other tileset. Can anybody explain or share a code for the same? Thanks

  • HT1689 I cant figure out how to add my itunes music to my ipod, I am using my computer.

    I have Itunes downloaded on my computer, but cant seem to figure out how to download it onto my ipod.

  • Not enough amount of characters in field

    In our company we have decided to use the field "Reference" in forms "Outgoing Payments" & "Incoming Payments" (there are fields OVPM.CounterRef & ORCT.CouterRef) like the field "Customer Ref. No." in forms "A/R Invoice" & "A/P Invoice". These fields

  • Connect smart card reader over usb and access digital signature certificate

    Hi, I got digital signature certificate stored in a smart card.I places smart card into card reader and plugged usb port of server. I can see card reader in windows environment.My problem is to connect card reader and access digital signature certifi

  • Entourage content ERASED ! -HELP

    Hi this morning upon turning on my computer I realized that the content in my Entourage was erased- instead prompting my to go through the 'welcome to entourage' screens-- UGH My address book ( 270 people ) and all of my messages help- is there any w