Results 1 to 3 of 3
  1. #1
    abhiramw is offline Member
    Join Date
    Sep 2009
    Posts
    1
    Rep Power
    0

    Default Generating an image from another image

    Hi all,

    I am looking out for a code where I can select a selected area of an image (by speicifying the pixels position) and then generate a new image of this selected area. Can someone help me out with this?

    regards,
    Abhiram

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Read the API specs for these methods and constructors and see if they help you

    A BufferedImage constructor that takes width, height and image type.
    The BufferedImage .createGraphics() method that returns a Graphics2D object.
    The Graphics2D.drawImage method that takes 10 or so arguments.

    ... in that order.

  3. #3
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    There are many ways to do this. You can do it with BufferedImage objects -- there are sub-image methods.

    Also, you can do this manually using a pair of nested for loops and two buffered images. This may be less efficient, but it will help you conceptualize what is happening. (hint: you can read one pixel at a time and save it in a second buffered image).

Similar Threads

  1. Replies: 1
    Last Post: 04-17-2009, 12:44 AM
  2. Replies: 14
    Last Post: 04-10-2009, 08:46 AM
  3. Replies: 4
    Last Post: 01-08-2009, 10:26 PM
  4. Canvas Image popups another image (SWT)
    By SpaceY in forum New To Java
    Replies: 2
    Last Post: 11-11-2008, 01:25 PM
  5. Replies: 0
    Last Post: 01-08-2008, 05:29 PM

Posting Permissions

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