Advertisement
Guest User

SWT custom ImageDrawPaintListener example

a guest
Jun 21st, 2011
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. String imgfile = "elephant.png";
  2. String homepath = System.getProperty("user.home");
  3. String imgpath = new java.io.File(homepath, imgfile).toString();
  4.  
  5. Image img = new Image(display, imgpath);
  6.  
  7. Label imagelabel = new Label(shell, SWT.NONE);
  8. imagelabel.addPaintListener(new ImageDrawPaintListener(img, 0, 0));
  9. imagelabel.addPaintListener(new ImageDrawPaintListener(img,  50, 50));
  10. imagelabel.setSize(400, 400);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement