[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Problems with Double Buffer

hi.

By using double buffer, while drawing bar chart with horizontal scroll, there's a problem when adding a legend. Trying to put a legend section on the top right side of a view, as we scroll it from left to right, the legend flickers often, which makes the problem.
how do we make it not flickering so that always setting it on the fixed place?
And also when using double buffer, when we draw the legend upon a image, then when scrolling it, the legend often disappears instantly.
I need any kind of help. thanks.




canvas.addListener(SWT.Paint, new Listener() {
	public void handleEvent(Event event) {
			event.gc.drawImage(image, 0, 0);
			
			
			/** draw legend **/
			event.gc.setBackground(color);
			event.gc.fillRectangle(x, y, w, h);
			event.gc.drawText(string, x, y);
			
			event.gc.dispose();
		}
	}
});