Results 1 to 3 of 3
  1. #1
    bikashg is offline Member
    Join Date
    Apr 2010
    Posts
    13
    Rep Power
    0

    Default Color over BufferedImage

    I have bufferedImage and I want to draw rectangles over it. Everything works fine, except that the color of the rectangle is always black even though I have the code like:

    g2d.setColor(Color.RED);
    g2d.fillRect(x, y, width, height);

    I think it is happening because the bufferedimage is black and white in color.

    Any ideas, please.

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

    Default

    Quote Originally Posted by bikashg View Post
    I think it is happening because the bufferedimage is black and white in color.

    Any ideas, please.
    Create a BufferedImage of type TYPE_INT_ARGB.

    kind regards,

    Jos

  3. #3
    bikashg is offline Member
    Join Date
    Apr 2010
    Posts
    13
    Rep Power
    0

Similar Threads

  1. BufferedImage - greyscale - color information
    By AndreB in forum Advanced Java
    Replies: 8
    Last Post: 03-04-2010, 10:09 AM
  2. BufferedImage rgb
    By Bill87 in forum New To Java
    Replies: 2
    Last Post: 02-25-2010, 06:31 PM
  3. [COLOR="Navy"]execute .bat file in mysql [/COLOR]
    By msankar.ravi in forum Networking
    Replies: 0
    Last Post: 02-24-2010, 04:27 AM
  4. Using BufferedImage
    By timkd127 in forum New To Java
    Replies: 5
    Last Post: 12-19-2009, 09:17 PM
  5. BufferedImage through FTP
    By dudejonne in forum New To Java
    Replies: 7
    Last Post: 11-05-2009, 05:36 PM

Tags for this Thread

Posting Permissions

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