Results 1 to 3 of 3
  1. #1
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    176
    Rep Power
    1

    Default Graphics 2D Shape Cutter for BufferedImages

    I'm going to make tiles for my RPG game, instead of drawing each shape of the tile, I will just draw the full tile in a spritesheet. I will create a sprite sheet of shapes that I want to clip somehow or use to cut the original full image into the shape I want. How can I, take a Buffered Image, cut it's shape and perhaps add something, giving me a Buffered Image of a cut tile with possibly added features that I can then draw with Graphics?

    Regards
    Augustas

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

    Default Re: Graphics 2D Shape Cutter for BufferedImages

    I don't understand what you want. It seems to me that drawing different shapes into images
    is about the same as drawing the cutter pattern to cut the shapes.

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

  3. #3
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    176
    Rep Power
    1

    Default Re: Graphics 2D Shape Cutter for BufferedImages

    Okay, ermm imagine you have a 16 x 16 square red image, and then you have another image that is also 16 x 16, one 8 x 16 half is transperant, the other 8 x 16 half is black, how can I use these two images together somehow to get a BufferedImage that now is a an image that the first half is red and the other is transperant. How to explain, I'll use images as examples:

    Graphics 2D Shape Cutter for BufferedImages-some-iamge.png

    So literally, the first image is a BufferedImage, the second image is a bufferedImage, the black borders surrounding the images in this example don't count as part of the image, the result image is also a buffered image. So basically the cutter shape is the second image. How can I do this process? Input two images, the second image's all black parts will be used as a position for turning the first image's parts transperant. How do I do this? Is it possible? How?

    Regards
    Augustas

Similar Threads

  1. Centering graphics on the graphics window
    By janyc71876 in forum New To Java
    Replies: 5
    Last Post: 11-25-2013, 08:25 PM
  2. Replies: 3
    Last Post: 09-16-2013, 09:51 PM
  3. Drawing a graphics onto another Graphics ?
    By Ziden in forum Java Applets
    Replies: 0
    Last Post: 01-08-2011, 08:30 PM
  4. Replies: 1
    Last Post: 04-02-2010, 01:48 PM
  5. rezise shape
    By frankenstein in forum Java 2D
    Replies: 5
    Last Post: 07-30-2009, 01:44 AM

Posting Permissions

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