My question : I have created and filled a Canvas in Eclipse RCP application as follows :
Canvas myCanvas = new Canvas(comImageViewer, SWT.H_SCROLL | SWT.V_SCROLL);
myCanvas.setLocation(0, 0);
myCanvas.setSize(583, 432);
myCanvas.setLayout(new FormLayout());
myCanvas.addPaintListener( new PaintListener() {
public void paintControl(PaintEvent e) {
GC gc = e.gc;
gc.drawImage( image,10,10); // Draw the moon
}
});
and by definition, this canvas has V_Scroll and H_Scroll bars, but they do not scroll the image displayed at run time. Now, My Requirements are:
The Image is too big for small sized Canvas. So, How can I make the loaded image :
Take a look at this snippet which explains how to scroll an Image on SWT Canvas.