Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.eclipse.swt.events.PaintEvent;
- import org.eclipse.swt.graphics.GC;
- import org.eclipse.swt.graphics.Image;
- public class ImageDrawPaintListener implements org.eclipse.swt.events.PaintListener {
- Image img;
- int posX = 0;
- int posY = 0;
- public ImageDrawPaintListener(Image img, int posX, int posY) {
- super();
- this.img = img;
- this.posX = posX;
- this.posY = posY;
- }
- @Override
- public void paintControl(PaintEvent e) {
- GC gc = e.gc;
- gc.drawImage(img, posX, posY);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement