Results 1 to 2 of 2
  1. #1
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Tucson, AZ
    Rep Power

    Default Drawing monochrome/alpha channel sprites in different colors

    Say I have one BufferedImage that is my canvas, and another BufferedImage that is a sprite sheet. I understand how to draw part of the sprite sheet onto the canvas. But I can't figure out how to draw the sprites in different colors, using the sprite sheet as an alpha mask.

    Any pointers?
    Get in the habit of using standard Java naming conventions!

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

    Default Re: Drawing monochrome/alpha channel sprites in different colors

    Would Graphics#setColor(...) followed by Graphics#setXORMode() do it?

    If you can use JavaFX, it has Effects for this kind of stuff (javafx.scene.effect.ColorAdjust)

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

Similar Threads

  1. green channel extraction
    By sarah49 in forum Java 2D
    Replies: 1
    Last Post: 01-27-2012, 12:14 PM
  2. Sprites - My Game (Sort of)
    By David M. in forum Java 2D
    Replies: 2
    Last Post: 04-26-2011, 12:00 AM
  3. Need Support for Using Network service providers channel to carry speech
    By Nagasubramanian in forum Sun Java Wireless Toolkit
    Replies: 0
    Last Post: 02-13-2009, 01:10 PM
  4. Help with Java IRC Chat Channel
    By sari in forum New To Java
    Replies: 1
    Last Post: 02-03-2009, 08:21 AM
  5. Replies: 0
    Last Post: 06-28-2008, 10: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