Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6731369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:31:13+00:00 2026-05-26T10:31:13+00:00

Have the following code: image = new Image(display, imageData); offScreenImageGC.drawImage(image, 0, 0, imageData.width, imageData.height,

  • 0

Have the following code:

image = new Image(display, imageData);
offScreenImageGC.drawImage(image, 0, 0, imageData.width, imageData.height, imageData.x, imageData.y, imageData.width, imageData.height);
/* Draw the off-screen image to the shell. */
shellGC.drawImage(offScreenImage, 0, 0);

… after executing the bottom instruction: shellGC.drawImage(offScreenImage, 0, 0); sometimes I get the image visible on the shellGC component, sometimes – not. I get it visible only when I “slow down” the execution of the program , for example when I am in debug mode. But when it runs fast – it does not show. I want it forcefully shown, flushed or whatever you name it, is it possible ?

Let me clarify that what I want to achieve is to implement an animation which is frame based, but yet to be able to play it double buffered, able to stop it, show only particular single frame paused, and etc things…

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:31:14+00:00Added an answer on May 26, 2026 at 10:31 am

    It came out that this is the ONLY SAFE way to double buffer with SWT:

    canvas.addPaintListener(new PaintListener() {
                  public void paintControl(PaintEvent event) {
                     //Obtain the next frame
                    ImageData imageData = imageDataArray[iad.imageNumber];
                    Image imageFrame = new Image(display, imageData);
    
                    // Create the image to fill the canvas
                    Image image = new Image(display, canvas.getBounds());
    
                    // Set up the offscreen gc
                    GC gcImage = new GC(image);
    
                    //Draw the image offscreen
                    gcImage.setBackground(event.gc.getBackground());
                    gcImage.drawImage(imageFrame, 0, 0);
    
                    // Draw the offscreen buffer to the screen
                    event.gc.drawImage(image, 0, 0);
    
                    imageFrame.dispose();
                    image.dispose();
                    gcImage.dispose();
                  }
                });
    

    …. by using this method ONLY for doublebuffering there is guaranteed crossplatform equal runtime behaviour, and the unpredictable buffer behaviour is also gone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code to display an image in imagebox using EmgucV: Capture
I have the following css code .container { width:800px; background-color:yellow; margin:auto; display:table; } .cell
I have the following code: Image tmpimg = null; HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url); HttpWebResponse
I have the following code to take an image and generate the thumbnail. how
I have the following code which renders an image as the background for a
I have the following code that produces a background image in a table cell.
I have the following css code. button.png is image where 3 button states are
I have the following javascript code, which is doing an image rotation on a
Android:How to display images from the web in a ListView?I have the following code
I have use following code to display category and there product on click patent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.