Results 1 to 4 of 4

Thread: Crop an image

  1. #1
    ZStrife is offline Member
    Join Date
    Apr 2017
    Posts
    2
    Rep Power
    0

    Default Crop an image

    EDIT: I fixed it i was compiling with the wrong variables plugged in
    Last edited by ZStrife; 04-20-2017 at 01:37 AM.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,170
    Rep Power
    12

    Default Re: Crop an image

    And how is that information going to help anyone? You should have left the original post and then posted the solution.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    ZStrife is offline Member
    Join Date
    Apr 2017
    Posts
    2
    Rep Power
    0

    Default Re: Crop an image

    Solution:
    I was trying to figure out how to crop an image for sprite animation.

    ground = new Image(fis = new FileInputStream("resources/maps/dungeonFloor0.png"));
    groundTexture = new ImageView(ground);

    Image protag = new Image(new FileInputStream("resources/characters/notBob.png"));
    pRead = protag.getPixelReader();
    WritableImage wImage = new WritableImage(pRead, 0, 0, WIDTH, HEIGHT); //0,0 tells the writeImage where to start, WIDTH HEIGHT tells the writeImage how much further read
    ImageView protagView = new ImageView(wImage);

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,170
    Rep Power
    12

    Default Re: Crop an image

    Sorry for being terse. Thanks for putting it back! And welcome to the forum.

    Regards,
    Jim
    Last edited by jim829; 04-20-2017 at 03:19 AM.
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. Replies: 0
    Last Post: 11-18-2016, 06:28 PM
  2. Replies: 4
    Last Post: 08-09-2012, 06:18 PM
  3. How to crop Images?
    By sgthale in forum New To Java
    Replies: 4
    Last Post: 12-08-2011, 06:56 AM
  4. Crop many images out of one image? Please help!
    By Alerhau in forum New To Java
    Replies: 3
    Last Post: 09-06-2011, 09:10 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
  •