Improve the animation performance (only re-draw the partial background)

i had an application involving animation. the whole animation is done without any external image files used. all the background and objects are hard coded drawn.
double buffering technique is used and the 1st code template is as follow:
paint
     draw_background_image
     draw_foreground_moving_object_at_latest_location
update
     draw_background_image
     draw_foreground_moving_object_at_latest_location
A thread calls repaint(int x, int y, int width, int height) where x, y, width and height is the rectangle region form by the object new location and the object old location. however, i stil found my application performance not too good :(
i was wondering whether i can have the performance of application improved with the following 2nd code template? (i havent implemented it yet since i do not know which API for me to achieve certain tasks)
paint
     draw_background_image
     draw_foreground_moving_image_at_latest_location
update
     draw_PORTION_OF_background_image_that_covered_by_previous_moving_object
     draw_foreground_moving_image_at_latest_location
in that case,
1. is the 2nd correct way to do animation compared with the 1st way?
2. if so, do i need to store portion_of_background_image_that_covered_by_previous_moving_object, the x and y location of the covered background image......? what API should i use in order for me to do so?
thank you very much!
regards
yan cheng

Here's a post from the game forum which will get you started
http://forum.java.sun.com/thread.jsp?forum=406&thread=417063&message=1844507#1844507

Similar Messages

  • I redirected iTunes to an external drive and moved my iTunes library and folder, but my hard drive is still low on space.  How can I be sure that my music is all on the external HD ONLY, especially with the new iCloud technology?

    I redirected iTunes to an external drive and moved my iTunes library and folder, but my hard drive is still low on space.  How can I be sure that my music is all on the external HD ONLY, especially with the new iCloud technology?  It doesn't look like I created any more space by doing this, AND I totally lost all my iTunes playlists.  I'm not sure if because I added old library materials manually if this messed up my playlists, or if the new location is just not reading my moved library.  In any case, I followed step by step instructions and found a few holes and thought I'd just "figure it out" but I guess I'm not as smart as I thought since I'm still scratching my head many hours later.
    Thanks for any support ;-)
    Eaglerocker

    Quick answer if you use iTunes' default preferences settings:  Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive.  Open iTunes and immediately hold down the option (alt) key (shift on Windows) so you get a prompt to select a library, then guide it to the 'iTunes Library.itl' file in the moved iTunes folder.
    If this is to a new computer and you put the copied iTunes folder in the default location of Macintosh HD > Users > *User Name* > Music  then you don't even need to start with the option key held down, iTunes will automatically look for it there.  (Make sure there isn't anything already in the iTunes folder there that you want to keep since you will be replacing it with the one you are moving.)
    iTunes: How to move [or copy] your music [library] to a new computer [or another drive] - http://support.apple.com/kb/HT4527 - a somewhat bewildering and not always easily understandable set of options.

  • HT1296 Can't get my Music off of my iPhone 4. My computer died & had to get a new one, so now I cannot sync my iPhone 4 with the new computer, without losing all of my Music, because the only Music I have is on the iPhone 4 only, not on the computer. Help

    Can't get my Music off of my iPhone 4...
    My computer died & had to get a new one, so now I cannot sync my iPhone 4 with the new computer, without losing all of my Music, because the only Music I have is on the iPhone 4 only, not on the computer. No Backup anywhere : (
    If I choose to sync it tells me all of the Content that does not match the iTunes library on the computer will be erased, do you want to proceed & I have to say no.
    How do I replace the music library on my Computer with the Music on the iPhone?
    I got my pictures off because you can access them when you connect the iPhone using Windows 7 but you cannot see any of the music so you cannot access it when using windows so don't know what to do...
    Help...

    The music sync is one way - computer to iphone.  The only exception is itunes purchases.  File>Transfer Purchases
    It has always been very basic to always maintain a backup copy of your computer for just such an occasion.  Use your backup copy to move everything to your new computer.

  • When I run the cursor over a template it shows several pages but when i select the document it only brings up the first two pages to edit. How do I see them all?

    When I run the cursor over a template it shows several pages but when i select the document it only brings up the first two pages to edit. How do I see them all?

    Skimming the templates in the Template Chooser shows you all of the pages available in the template once you open it. You can insert the one(s) you want, even more than one of any of them. Most users don't want or need all of the different pages, especially when they start the document.

  • The CustomDatumExample.java only works if the Employee object has 2 attributes.

    The CustomDatumExample.java only works
    if the Employee object has 2 attributes -
    (EmpName and EmpNo). If I try to add
    another attribute to the Employee object I get java.lang.ArrayIndexOutOfBoundsException: 2 on the getAttr3 method.
    Anyone know why? Thanks.
    Employee object
    CREATE TYPE employee AS OBJECT
    (empname VARCHAR2(50), empno INTEGER,
    attr3 VARCHAR2(50));
    Custom object class
    public class Employee implements CustomDatum, CustomDatumFactory
    public static final String SQLNAME = "EMPLOYEE";
    public static final int SQLTYPECODE = OracleTypes.STRUCT;
    MutableStruct _struct;
    static int[] _sqlType =
    12, 4
    static CustomDatumFactory[] _factory = new CustomDatumFactory[3];
    static final Employee _EmployeeFactory = new Employee();
    public static CustomDatumFactory getFactory()
    return _EmployeeFactory;
    /* constructor */
    public Employee()
    struct = new MutableStruct(new Object[3], sqlType, _factory);
    /* CustomDatum interface */
    public Datum toDatum(OracleConnection c) throws SQLException
    return struct.toDatum(c, SQL_NAME);
    /* CustomDatumFactory interface */
    public CustomDatum create(Datum d, int sqlType) throws SQLException
    if (d == null) return null;
    Employee o = new Employee();
    o._struct = new MutableStruct((STRUCT) d, sqlType, factory);
    return o;
    /* accessor methods */
    public String getEmpname() throws SQLException
    { return (String) _struct.getAttribute(0); }
    public void setEmpname(String empname) throws SQLException
    { _struct.setAttribute(0, empname); }
    public Integer getEmpno() throws SQLException
    { return (Integer) _struct.getAttribute(1); }
    public void setEmpno(Integer empno) throws SQLException
    { _struct.setAttribute(1, empno); }
    public String getAttr3() throws SQLException
    { return (String) _struct.getAttribute(2); }
    public void setAttr3(String attr3) throws SQLException
    { _struct.setAttribute(2, attr3); }
    }

    You also need to add an appropriate element to the _sqlType array.
    In practice, it is easiest to have JPublisher regenerate the CustomDatum class when you have changed your object type definition:
    jpub -user=scott/tiger -sql=EMPLOYEE:Employee

  • How to get the health , performance information and about the services run on devices that have connected to the system center?

    Hi All,
    I want to know how to get the health , performance information and about the services run on devices that have connected to the system center to my c# application. Also I need to know about the information of databases that have connected to system center.
    I will appreciate your feedback
    Thank you

    Hi,
    You can configure service monitor for the required service on the server
    refer below link for how to configure service monitoring
    http://www.bictt.com/blogs/bictt.php/2011/03/17/scom-monitoring-a-service-part3
    You can use SCOM SDK to connect to the scom server using c# and get required information
    http://msdn.microsoft.com/en-us/library/hh329086.aspx
    you can find the database in below registry path on management server
    HKLM:\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup\DatabaseName
    Regards
    sridhar v

  • [svn:fx-trunk] 5812: Fixed a bug where direct use of Animation failed because AnimationProperty was not setting up its internal keyframes with correct duration information , so the animation would skip immediately to the end.

    Revision: 5812
    Author: [email protected]
    Date: 2009-03-31 11:34:56 -0700 (Tue, 31 Mar 2009)
    Log Message:
    Fixed a bug where direct use of Animation failed because AnimationProperty was not setting up its internal keyframes with correct duration information, so the animation would skip immediately to the end.
    Bugs: SDK-20356
    QE Notes: spark/effects Mustella tests currently hosed, couldn't run test suite
    Doc Notes: None
    Reviewer: Jason
    Testing: checkintests, Mustella effects tests could not be run (post-rename issues)
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-20356
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimationProperty.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Animation.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateColorIns tance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateShaderTr ansitionInstance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/FadeInstance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/MoveInstance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/ResizeInstance. as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/Rotate3DInstanc e.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/RotateInstance. as

    Hi
    Can you please try setting up full persmission in the security properties for everyone on the wsconfig folder C:\ColdFusion10\config\wsconfig  and restart ColdFusion Server.
    Swaraj

  • I have an old mac 10.6.8. I wish to install a iphoto program, but i believe my mac will only support iphoto5. The app store only offers me the latest version. Any suggestions on where to get iphoto 5?

    I have an old mac and wish to install an iphoto program. The app store only offers me the latest version of iphoto, but I think the mac can only support iphoto 5. Any suggestions on where I can get iphoto 5?

    Do you have the disks that came with the old Mac?  If you do you can install the iApps from one of those disks.
    Otherwise, what Mac model do you have? Go the the  ➙ About This Mac menu and then click on More Information.  In the System Information under Hardware you'll find Model Name.  What is the model?  I'tll be something like Macbook 5,2.
    OT

  • Is possible to make the bookmarks bar only appear on the homepage?

    I was just wondering if it was possible, with or without an add-on, if i could make it so that the bookmarks bar only appears on the homepage.

    I have the bar under the adress bar for bookmarks. But i use lots of bookmaks. When i nedd to access them i press the icon you told,and the side bookmaks bar is shown, and is this bookmaks left side bar that i wish to be permanently there.
    What happens is that i open it, choose the bookmark to be open and then it disappears...
    On Safari, differently from Firefox, when i press the icon it shows a complete page instead of the side bookmaks bar only.

  • If i dont use the display when using the GPS and only listen to the voice instructions can that also makes the iphone overheat even if you dont use the display

    because when i use the gps app in my iphone 4s in the car my iphone gets overheat so
    if i dont use the display when using the GPS and only listen to the voice instructions can that also makes the iphone overheat even if you dont use the display
    will that help?

    When you use your GPS does your iPhone get hot enough to shutdown?  The reason I ask is that I have run my GPS app with the screen brightness set to near max connected to power for hours.  My iPhone got hot, but didn't shutdown.

  • Hi, I can't restore my iphone 4. When he's about to finish the restoration, it stops. Don't let me turn on the iphone, and only show me the apple icon, or a "load itunes" icon. Someone can help me please? Thank you!

    Hi, I can't restore my iphone 4. When he's about to finish the restoration, it stops. Don't let me turn on the iphone, and only show me the apple icon, or a "load itunes" icon. Someone can help me please? Thank you!

    We are users like you and won't be able to extend your warranty. You will need to physically return the device to the USA for warranty service as you probably already know. Here is an article that deals with error #2001: Resolve iOS update and restore errors

  • Is there a way to decrypt the SQL login-only encryption in the netmon trace or disable the SQL login-only encryption?

    We know by default the SQL Server use the self-signed certificate to encrypt the  SQL login information when  building the connection, my question is if
    there is a way to decrypt the SQL login-only encryption in the netmon trace  or disable the SQL login-only encryption?
    Please click the Mark as Answer button if a post solves your problem!

    Not without login as admin.   To avoid using credentials to login to SQL, use Windows Credentials instead.
    jdweng

  • Updates all the photos (cameraroll) in iCloud or is it just photo stream when you sync? I have 5000 photos in the camera but only 800 in the stream and I would like to save them all. How to do?

    updates all the photos (cameraroll) in iCloud or is it just photo stream when you sync? I have 5000 photos in the camera but only 800 in the stream and I would like to save them all. How to do?

    Plug your iPhone into your Mac and open iPhoto. Transfer the photos from the phone to your Mac.

  • TS1381 The X key only works when the shift key is depressed

    The X key only works when the shift key is depressed.  can only type capital

    I have this same issue with the Letter L.  I can ony type it with a captiaL L.  The Lowercase L does not work in Safari, but works in other programs.
    This suggestion did not work for me.

  • When I try to download a program, the pop-up only gives me the option to "save" the program, instead of giving me the option to "run" the program. How do I fix this?

    I have tried downloading iTunes (and Quicktime), but instead of giving me the option to "run" the program, Firefox only gives me the option to "save" the program (which I already tried, does not work to give me access to the downloaded program). Is there a setting I need to change?

    That's intentional, because running exe files from your browser is a major security concern. You can run the file after you have downloaded it. If you don't know where it is on your computer, go to '''Tools > Downloads''', and double-click on it from the Downloads window.

Maybe you are looking for

  • Error in select table from package

    hi all, I am using Oracle 10.02.04. I have a package named as N_UTL. In this package (N_UTL) I have a select as       SELECT COUNT (*)         INTO n         FROM MDSYS.sdo_index_metadata_table        WHERE sdo_index_owner = USERI get a complication

  • Will Airplay work without AppleTV?

    Hello - can you please let me know that now i have downloaded the latest ipad software 4.2 and when I play a movie, the airplay icon does not a appear, this may be a silly question - but do I need to have an Apple TV box first for the feature / logo

  • I need help with Adobe Momentum Connect. Am I in the right place?

    I am trying to log on to an Adobe momentum Connect meeting. I am the host. When I click on the URL for the meeting the screen gets stuck in a never-ending screen saying "Loading Adobe Connect" I can enter the meeting with other computers but not my V

  • Lightroom - Export error from Admin account

    Lion 10.7.4 MacPro  -  I cannot export from Lightroom 4 in my main Admin account. Lightroom gives me an error message - When I create a new admin account I can export from LR4. It also works on my two laptops. Spent much time with Adobe and it was de

  • ICM MR PG and Outbound Dialer

    Hi, I am trying to install Outbound option for IPCC Enterprise 7.5.1 and I am having some problems with it. My setup is as follows Server 1 : RouterA, LoggerA, PG1A(CCM PG), CG1A, CTIOS1, DialerA, PG2A(MR PG with two PIMs for the two dialers); Server