Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Backscreen Scrolling
Backscreen Scrolling [message #467050] Mon, 23 January 2006 19:09
Dominic Cubitt is currently offline Dominic CubittFriend
Messages: 2
Registered: July 2009
Junior Member
Hi,

I am developing an app on the Pocket PC and am having serious problems when
scrolling. There is much flickering and partial redraw when scrolling a
composite containing a few labels and such. This is because the redraw is
called every time.

I am using J9 with 3.2 M4 PPC j2se.

I have tinkered extensively with DOUBLE_BUFFERED and NO_BACKGROUND that do
make some difference, but by no means enough.

I have investigated further; and scrolling of an image seems to work very
well.

So what i want to do is render my component(s) to a backscreen and copy the
appropriate image segment to a canvas for normal drawing.

I have had some success with this using code like:

public void setContent(Composite c){
this.content = c;
content.setVisible(true);
}

void paintControl(PaintEvent e) {
Point contentSize = content.getSize();
GC gc = new GC(content);
Image image = new Image(content.getDisplay(), contentSize.x,
contentSize.y);
gc.copyArea(image, 0, 0);
gc.dispose();

gc = e.gc;
gc.drawImage(image, 100, offsetY);
image.dispose();
gc.dispose();
}

The problem here is that the content component needs to be visible for me to
take an image - this defeats the point in the first place. However the image
to the right scrolls very smoothly despite me taking a new image every time!

I would very much like to build a generic solution to this as scrolling is a
significant feature of the application.

Any advice on how to correctly render component(s) to a backscreen would be
much appreciated.

Regards,
Dominic,
Previous Topic:sizing Text
Next Topic:How to build EXE for SWT Application
Goto Forum:
  


Current Time: Tue Apr 23 09:11:26 GMT 2024

Powered by FUDForum. Page generated in 0.03482 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top