[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.swt] Re: SWT and double buffering
|
Someone pointed out a programming error. The Image should be disposed so the code
becomes
> control.addPaintListener(new PaintListener(){
> public void paintControl(PaintEvent event){
> Image bufferImage = new Image(display,width,height);
> GC bufferGC = new GC(bufferImage);
> // Do lots of drawing onto the GC
> event.gc.drawImage(bufferImage,0,0);
bufferImage.dispose();
> }
> });
For more info on resource disposal see:
http://www.eclipse.org/articles/swt-design-2/swt-design-2.html.
Best regards,
Joe