I'm looking for a fast and easy way to plot arbitrarily colored pixels in an SWT Canvas. So far I'm using something like that:
// initialization:
GC gc = new GC(canvas);
// inside the drawing loop:
Color cc = new Color(display, r, g, b);
gc.setForeground(cc);
gc.drawPoint(x, y);
cc.dispose();
This is horribly horribly slow. it takes about a second and a half to fill a 300x300 canvas with pixels. I could create an image off-screen, set the pixels in it and then draw the image. This will be faster but I specifically want the gradual painting effect of plotting the image pixel by pixel on the canvas.