Results 1 to 5 of 5
  1. #1
    bbpatil is offline Member
    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0

    Default New to GUI design Please help me to code

    Hi i am designing a GUI for the manipulation of images like rotate, blur, smoothing, flip an image & display the resultant image on the either side.
    1. Taking 2 panels/frames as input & output.
    2. Read image and place on the input panel.
    3. When i click on rotate button,the rotated image should be displayed on the output panel.
    4.If i click on camera button the web camera should appear on the input panel.
    5.In a camera mode if capture button is clicked,captured image should appear on the output panel and the same process with video.
    New to GUI design Please help me to code-gui-design.png
    Last edited by bbpatil; 09-27-2012 at 10:57 AM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,453
    Rep Power
    20

    Default Re: New to GUI design Please help me to code

    Did you just want to share your goals, or do you have a question? We won't write your code for you, but we can guide you to resources and help you to understand enougn to write it for yourself.

    Here's a good place to start: Trail: 2D Graphics (The Java™ Tutorials)

    Also, this is really about Java 2D, not NetBeans, so I shall move this thread.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    bbpatil is offline Member
    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0

    Default Re: New to GUI design Please help me to code

    Hi even i m not asking for write & give the code..i am asking suggestions to write code.
    Now i m am need of projecting camera on panel or frame can anybody get ideas

  4. #4
    AeneasTroy is offline Arma virumque cano
    Join Date
    Oct 2012
    Location
    Indianapolis
    Posts
    20
    Rep Power
    0

    Default Re: New to GUI design Please help me to code

    For starters, you are probably going to want to work with a bufferedimage: Lesson: Working with Images (The Java™ Tutorials > 2D Graphics)

    This can be drawn onto anywhere in your program, and then passed to the paint() function. Then the paint function will draw the buffered image.

    Each panel will need its own paint function.

    You can retrieve the image from panel1 when the rotatebutton is clicked.

    then you can have a separate buffered image for panel2. You use a Graphics member to paint onto buffered Image, just like you would onto a swing component:

    Java Code:
    BufferedImage img = new BufferedImage(250,300 BufferedImage.TYPE_INT_RGB);
    //This makes a 250 x 300 pixel image that uses RGB colors.  Check out the different types that you can use!
    Graphics gfx = img.getGraphics();
    
    gfx.drawLine(0, 0, 100, 100);
    //no gfx draws on the buffered Image
    ...
    ...
    ...
    public void paint(Graphics g){
        //now in the paint method
        BufferedImage buff = myMethodToRetrieveTheBufferedImageIMade();
        
        g.rotate(-Math.PI()/2); //Use the math.PI for theta.  I forget exactly what formula you use for -90 degrees.  -Math.PI * something/something
       
        g.drawImage(buff, x, y, this);
        //Now it should draw the bufferedImage. 
         //
    }

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,453
    Rep Power
    20

    Default Re: New to GUI design Please help me to code

    1. paint(...) is the wrong method to override for painting to Swing components.
    2. Java has methods, not functions. You've been told this before.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Preview design vs Run design
    By diamonddragon in forum NetBeans
    Replies: 3
    Last Post: 02-06-2012, 09:11 AM
  2. How enter this mode-gui/design-view/code-view
    By lse123 in forum NetBeans
    Replies: 0
    Last Post: 02-28-2010, 10:09 PM
  3. Design/code reusage problem
    By turanan in forum New To Java
    Replies: 12
    Last Post: 01-22-2010, 11:27 AM
  4. help: I want to design 2D map?
    By mofaker in forum AWT / Swing
    Replies: 4
    Last Post: 10-29-2009, 01:34 AM
  5. JSP Design.
    By makpandian in forum NetBeans
    Replies: 0
    Last Post: 04-20-2009, 02:21 PM

Tags for this Thread

Posting Permissions

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