Results 1 to 3 of 3
  1. #1
    crikey is offline Senior Member
    Join Date
    Jul 2010
    Posts
    125
    Rep Power
    0

    Default Cropping a BufferedImage

    Suppose I have a BufferedImage thats size is 1366x768, and I want to select only a part of it at location p and size(x,y) (like setBounds(x,y,xWidth,yHeight). How should i go about doing this? Thanks!

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,785
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by crikey View Post
    Suppose I have a BufferedImage thats size is 1366x768, and I want to select only a part of it at location p and size(x,y) (like setBounds(x,y,xWidth,yHeight). How should i go about doing this? Thanks!
    Did you read the API documentation for the BufferedImage class? It has a method that can give you the Raster for any Rectangle in the BufferedImage.

    kind regards,

    Jos

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

    Default

    And also a method to get a sub image of a rectangular region of the original image.

    db

Similar Threads

  1. Image cropping
    By pads in forum AWT / Swing
    Replies: 3
    Last Post: 06-23-2010, 04:32 PM
  2. bufferedImage
    By ranadav in forum New To Java
    Replies: 3
    Last Post: 06-05-2010, 04:22 PM
  3. BufferedImage rgb
    By Bill87 in forum New To Java
    Replies: 2
    Last Post: 02-25-2010, 07:31 PM
  4. Using BufferedImage
    By timkd127 in forum New To Java
    Replies: 5
    Last Post: 12-19-2009, 10:17 PM
  5. Image cropping in Jsf on the release of mouse
    By HarshalAuro in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 11-12-2008, 07:24 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
  •