Results 1 to 2 of 2
  1. #1
    dunff2k is offline Member
    Join Date
    Nov 2008
    Rep Power

    Default Double Buffering

    Hey guys,

    I've seen all the chat on double buffering, yet having followed the guidelines my scribble application still flickers really badly. Here is the paint method:

    Java Code:
    	public void paintControl(PaintEvent arg0) 
    		Image bufferImage = new Image(s.getDisplay(), s.getBounds());
            GC gcImage = new GC(bufferImage);
            // Draw the background
            // draw the stack of points I have been collecting from mouse events
    		for (int i =0;i<(l.size()-1);i++)
    			gcImage.drawLine(l.elementAt(i).x, l.elementAt(i).y,l.elementAt(i+1).x,l.elementAt(i+1).y);
    		// draw the buffered image to the screen
    		arg0.gc.drawImage(bufferImage, 0, 0);
    		// Clean up

    Any ideas why?

  2. #2
    dunff2k is offline Member
    Join Date
    Nov 2008
    Rep Power

    Default sorted

    Think I've sorted this, it seems the OS was redrawing the background when I was doing that creating a shell with SWT.NO_BACKGROUND as a parameter in the constructor was the solution

Similar Threads

  1. [SOLVED] Double Buffering
    By Zosden in forum AWT / Swing
    Replies: 1
    Last Post: 07-24-2008, 02:28 AM
  2. Double Value problem
    By sakthivel123 in forum New To Java
    Replies: 2
    Last Post: 07-10-2008, 04:18 PM
  3. Replies: 0
    Last Post: 06-28-2008, 09:23 PM
  4. Double Buffering problem
    By aprenz in forum Java Applets
    Replies: 0
    Last Post: 05-28-2008, 04:26 AM
  5. Calculating sin of a double value
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-13-2008, 08:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts