Results 1 to 3 of 3

Thread: Image class in JAVA

  1. #1
    Join Date
    Aug 2009
    Posts
    37
    Rep Power
    0

    Default Image class in JAVA

    I am new in programming word. I am learning JAVA programming language. I want to know about the Image class in JAVA and also know what are the properties and methods of the Image class. I have referred lots of books but none of them worked out. If you are having any suggestions then reply me. It can helpful to me.

  2. #2
    Carsten Marius is offline Junior Member
    Join Date
    Sep 2009
    Posts
    29
    Rep Power
    0

    Default

    I suggest you to refer following example of Image class', which will give you something idea about the use of this class:
    Code:
    import org.eclipse.swt.SWT;
    java.awt.Image
    import org.eclipse.swt.widgets.Shell;
    public class ImageDM {
      public static void main(String[] arhhgs) {
        final Display display = new Display();
        final Shell shell1 = new Shell(display);
        shell1.setText("Canvas Example");
        shell1.setLayout(new FillLayout());
        Canvas canvas1 = new Canvas(shell, SWT.NONE);
        canvas1.addPaintListener(new PaintListener() {
          public void paintControl(PaintEvent e) {
            Image image = null;
            try {
              image = new Image(display, ImageLoadFromClassStream.class.getResourceAsStream("test.gif"));
              } catch (Exception e1) {
                   e1.printStackTrace();
            }
            e.gc.drawImage(image, 25, 5);
            }image.dispose();
    }

  3. #3
    Jonas Volkard is offline Member
    Join Date
    Sep 2009
    Posts
    34
    Rep Power
    0

    Default

    Refer following methods of Image class, which is helpful for u:

    1.getWidth(ImageObserver ImgObserver)
    2.getScaledInstance(int width1, int height1, int hints1)
    3.getProperty(String strg, ImageObserver ImgObserver)
    4.getGraphics()
    5.getHeight(ImageObserver ImgObserver)

Similar Threads

  1. FileWriter class in JAVA
    By Theodosia Goodman in forum Programming
    Replies: 2
    Last Post: 03-30-2010, 12:37 PM
  2. TextComponent class in java
    By AllenBrown in forum Programming
    Replies: 2
    Last Post: 03-08-2010, 01:59 PM
  3. Image class in JAVA
    By Hernandez Ibbie in forum Linux/Free BSD
    Replies: 2
    Last Post: 02-27-2010, 09:31 AM
  4. Canon image class MF 4680
    By clodey65 in forum Printer
    Replies: 0
    Last Post: 09-14-2009, 09:50 AM
  5. Canon Image Class MF4320D
    By willi in forum Printer
    Replies: 0
    Last Post: 01-24-2009, 10:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48