Cannot change colors in Image

Hi All,
I really don't know any further in that problem, it can only be a small thing, but I don't come behind:
I'm creating a JPanel component with its own paingComponent method so that I can draw some things within that component:
JPanel p = new JPanel() {
               Image baseIm;
               public void paintComponent(Graphics g) {
                    super.paintComponent(g);
                                Image im = createImage(getWidth()-10,getHeight()-10);
                                im.getGraphics().setColor(new Color(255,0,0));
                                im.getGraphics().drawLine(0,0,100,100); // as an example
                    g.drawImage(im,5,5,this);
          };This always produces me a line, but in black color instead of red!
I tried it also with setColor(Color.RED), and with fillRect, but it is everytime the same: Every color I set to the Image's Graphics component is interpreted as black.
Setting the color directly on the JPanel's Graphics class is working fine, but this is not that what I want.
Has anyone an idea?
thanks in advance
alex,

the "getGraphics" method creates a new graphics object and disposes of the old one. So when you call "getGraphics" make sure to retain the Graphics object returned and use it until you're finished.
On another note, you should probably not create a new image within the paintComponent method every time, just once, like this:JPanel p = new JPanel() {
               Image baseIm;
               public void paintComponent(Graphics g) {
                    super.paintComponent(g);
                    if (baseIm == null)
                         baseIm = createImage(getWidth()-10,getHeight()-10);
                    Graphics gImage = baseIm.getGraphics();
                                gImage.setColor(new Color(255,0,0));
                                gImage.drawLine(0,0,100,100); // as an example
                    g.drawImage(im,5,5,this);
          };

Similar Messages

  • Changing color of Image in PSE 8.0

    I have a logo design that is black on white.  I'd like to change the black to another color - in this case, blue.  I wqas able to do it, but it ended up being quite convoluted.  What are some simple ways to change the color of a selected area in Elements 8.  I'm using a PC, BTW.
    Thanks!

    Thank you.  I found another way that's even simpler.  I chose the paint brush, set the mode to lighten, and then just painted over the image with blue - the white didn't pick up any of the blue, but the black did.
    Date: Tue, 22 Feb 2011 17:02:09 -0700
    From: [email protected]
    To: [email protected]
    Subject: Changing color of Image in PSE 8.0
    1. Select the black (use the magic wand if it's all one color).
    2. Layer>New Adjustment Layer>Hue Saturation.
    3. Turn on the colorize checkbox in the layers panel, and move the sliders till you see the color you want.
    >

  • Cannot change Color mode

    Hello,
    I was provided a file from a customer that is RGB. I need to change it to cmyk for printing. HOwever I cannot change the color mode. All my options in the Mode section under Image are greyed out. I have never seen this happen before.. Here is a screen shot of the Mode.
    The image has been flattened. I am using PS cs6 on a mac. I have never seen this happen before. Does any one have any ideas?

    Strange. Could the file permissions be set to lock you out?
    In the Finder, do a Get Info in the file and look at the permissions. If at the bottom, your name says "read only," then you need to change the permissions to allow you to read AND write.
    To change permissions, use BatChmod, but be careful to change the permissions on that file ONLY.
    It's FREE at:
    http://www.lagentesoft.com/batchmod/index.html
    ... And if that doesn't solve the problem, can you share the file?

  • Cannot change Desktop Background image

    When I go to change my Desktop Background, it will try and load up the pictures in my Pictures folder (but no subfolders). I can switch my background to one of these images, even though the "Loading" progress bar is still visible.
    Here is the odd thing, however. If I click on any of the other types of images (Apple Images, nature, Plants, Black & White, Abstract, and Solid Colors), nothing appears. I jumped over to another user on the same computer, and those images populated properly. Any ideas on what is going wrong? Why can't I change my background image? I've had this problem with both Mac OS 10.5.0 and 10.5.1.

    I managed to fix this problem.
    I did verify and repair permissions just for kicks. Not sure if that helped or not, but I did it anyway.
    Then I went back into the System Pref pane, and clicked on Apple Images, then clicked on the Change Picture checkbox. While none of the images appear in the white box, my background did change to one of the Apple Images (such as the black and purple Leopard-only background). I then closed System Preferences, opened it back up, and the images loaded up properly this time!

  • Cannot change color of png image in AI

    I downloaded a camera png image (http://simpleicon.com/camera.html) and am trying to change its color to red (B03B28). But the fill box is not working. It shows like the item is red but it will not change. Can the color be changed?

    go back to the download site and get the .svg file--that will open in Illustrator and you can change the color--the only way to change the color with the .png file is in photoshop

  • How to change Color of IMAGE Links

    Page properties is the only place I can find to change the
    color of LINKS. It works for text, but not for the border it
    automatically puts around a linked image. It's purple! Can't I make
    it white to blend in with the background? I have already changed
    all the link colors in the page properties to white and the link
    around the image is still purple! Is anyone familiar with this
    phenomenon and how to get around it?
    (BTW - in case you're wondering, there is no border
    specified in the properties or the css style)

    Of course, your method will not validate, while Osgoods will.
    And his will
    work, too, assuming it's properly implemented.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "EviePhillips" <[email protected]> wrote in
    message
    news:fpfp24$kjr$[email protected]..
    > Osgood:
    >
    > Thank you for responding. I did as you suggested and
    alas, it did not
    > work.
    > But you got me thinking about HTML code and so I went to
    the HTML Tutorial
    > website. I found some Image Border jargon. I entered
    Border=0 in the
    > Image
    > Source code and it worked. No more Purple link border.
    >
    > Thank you for turning on the light! I appreciate your
    help!
    >
    > Evie
    >

  • Change Color of Image? I need a Mentor!

    Hello to all,
    I am really needing some help.
    I am trying to build a script that will allow a user who visits a website to change the color of a house.
    For an example, when a user visits the site they are able to view a picture of a house with a default color of white. When the click on a button "Roof" the user is able to pick from a select number of roof color options.
    Same goes for siding, and trim.
    This is for a painting site for a family member that I am trying to help. I am hoping with a web presense in this economy, maybe it will turn things around.
    What I have seen,
    I have seen some sites use shape overlays.
    So they take an image, and (I am not sure if it is in Flash or Photoshop) they make a cut out of the roof, then they make 10 copies of it in different colors. For some places I have seen them descibe it at frames for each color. Yet I am not sure how you call upon it on click?
    Anyways I am very lost and need a mentor.
    Here is an example of what I am trying to do, but with a house:
    www.mortonbuildings.com/Two-Stall.aspx
    Thanks for anyones help. If you have a donation site let me know as I am appreciative of any and all help. I have even been looking for a coder to help walk me through this, but no luck finding an expert in this.
    Thanks
    Chris

    to do it yourself search for:  swap images actionscript 3 tutorial
    if you want to do this in as3.
    if you want to hire someone to do the coding for you, send me an email via my website:  www.kglad.com

  • I cannot change color of vector object

    I bought an image from shutterstocks... But when I change a colour, it all turns in monochrome colour. My Ai (CS6) knowledge is very limited, so I do not know what to Google "How to..."
    I would say that in a moment I change colour Ai understands that I colour in borders and all lines overlaps each other... However, I do not colour borders...
    Image is very complex pattern and I believe it is somehow related with image production... The image does not appear as it looks like - everything is over layered with cut-outs of object above... But it is beyond my knowledge...
    I have tried to ungroup but with same results...
    Could you please explain how to manipulate this image? Thank you!

    If this helps, here is a print screan as I cannot uploud real image... This image consists of 1 layer that is divided in thons of paths and some Compound Paths...
    Thanks a lot!

  • Merging Visible changes color of image!?

    using original CS
    every so often, like tonight, i've got a file with many layers of hue, bright, color balance, and more. i've gotten it to exactly where i want it, and want to move the whole thing in one piece to another file. so i merge visible. 95% of the time the result is a merged image that is identical to what it was in layers.
    but sometimes there are slight but important changes to the color or hue. (flatten image also has the same prob a fraction of the time)
    what can possibly be the problem here?

    ok, i re-did this operation so it merged the way i wanted it to merge, but still i see differences. but NOT when i view at 100%. i did not know that:
    >>What you see when you look at an image at any magnification other than 100% are interpolated pixels and not the actual pixels.>>
    this is invaluable info--thank you. still, i dont understand why 95% of the time when i merge visible--at whatever magnification--the image looks the same.

  • Cannot change group chat image

    Version: 6.16.0.105
    When I start a group chat, I can no longer change the picture for that chat.  On hover, there is no "change: option.  However, when I navigate to older group chats, I can still update the photo.
    Ideas for what is happening?

    Group chat pictures are not displayed and cannot be changed in Skype 6.21.64.104 or 6.21.85.104 (preview) Windows version:
    http://community.skype.com/t5/Windows-desktop-client/Feedback-on-Skype-6-21-85-104-preview-for-Windo​...
    You can uninstall the special 6.21.64.104 version (with new user interface) and install the regular 6.21.0.104 version where the profile pictures are displayed:
    http://download.skype.com/msi/SkypeSetup_6.21.0.104.msi
    In the case of new (cloud-based) group chats, the group picture cannot be changed in any current Skype Windows version.

  • Change color background image

    Hello,
    I am making a flyer and i want to have a background like this.
    I have been trying to search for tutorials but can't find what i am looking for.
    How do you do this? Or where can i find a tutorial for this ?
    Amber

    That background is an image. You can do the same thing by adding an image to the page to serve as a background, or you can use a frame filled with a solid color or a gradient fill.

  • Cannot change color or underline hyperlinks in iWeb

    Hi,
    I've seen others post regarding this same issue, but there is no way I have been able to rectify the issue. For some reason when I try to change the color with the Inspector of my iWeb hyperlinks (as well as try to underline them), the Inspector shows that I have changed the color and underlined it, and it looks like it should on the page as I'm working on it, but when I publish it the colors and underline are not there. Any suggestions? I'd really appreciate it. Thank you in advance!
    C

    Hi,
    I'm using Safari, I tried to find a place to change the colors on the page (using Safari) and I don't see where I would do that, but I'll keep trying.
    I did try publishing to All to .Mac option but everytime I do that, I get a Publishing Error and so far I've tried deleting things to avoid that error (for example, it said that my photo albums were not publishing correctly, so I deleted them all, but now it's telling me my blog has a publishing error; this doesn't happen when I publish to .Mac, only when I publish All to .Mac. Make any sense? I'm completely confused) and the error keeps coming up. Ugh. Here's a link to my page, sorry it's boring, it's meant for the grandparents back home.
    http://web.mac.com/jaycherylbaker/Site/Welcome.html
    Oh, and I'm also getting those text box lines on one or two of the pages. For some reason they weren't there a few days ago b/f I started messing with this. I wish I had left it all alone now instead of trying to get the hyperlinks in blue! LOL! Oh well!
    Message was edited by: jaycheryl

  • Cannot Change Color in Stage, creationComplete, on Launch

    This may be a little hard to explain, but I am on Edge Animate 3.0, and I am experiencing an issue with dynamically changing the color of a div when I put the code in Stage, creationComplete.
    In the sample file I have shared, I have defined two functions. One changes the color of tabs and changes the text for the active tab. The other displays the hex and rgb values of a div that is passed to it.
    In both cases, when the functions are triggered with click events, they work as expected. However, at the bottom of creationComplete, I call both functions to initialize starting values on launch.
    With the tab function, the text changes as expected, but the tab color does not change to make tab 1 active.
    With the color function, the hex and rgb values are not displayed.
    Again, when you start clicking on tabs and cubes, you will notice that it works just fine.
    One note, I am using the rgbcolor.js library to get the hex value. However, it only is used in one of the functions, and I was experiencing this issue with the tabs before I add rgbcolor.js to the project.
    Any thoughts you may have on what may be causing this issue will be greatly appreciated.
    Thanks!
    Sample Project Files:
    http://adobe.ly/1enOc47
    Fred

    Hi,
    I'm using Safari, I tried to find a place to change the colors on the page (using Safari) and I don't see where I would do that, but I'll keep trying.
    I did try publishing to All to .Mac option but everytime I do that, I get a Publishing Error and so far I've tried deleting things to avoid that error (for example, it said that my photo albums were not publishing correctly, so I deleted them all, but now it's telling me my blog has a publishing error; this doesn't happen when I publish to .Mac, only when I publish All to .Mac. Make any sense? I'm completely confused) and the error keeps coming up. Ugh. Here's a link to my page, sorry it's boring, it's meant for the grandparents back home.
    http://web.mac.com/jaycherylbaker/Site/Welcome.html
    Oh, and I'm also getting those text box lines on one or two of the pages. For some reason they weren't there a few days ago b/f I started messing with this. I wish I had left it all alone now instead of trying to get the hyperlinks in blue! LOL! Oh well!
    Message was edited by: jaycheryl

  • Portal Theme / Cannot change color of CRM iView?

    Hi there,
    i have a problem. I try to create a new Portal Theme.. The whole Portal should be grayed...
    It works perfectly for the whole Portal..  But we have implemented SAP CRM 2005 in our Portal.
    As you can see in this Screenshot: (If this link do not work.. please write me a message with your Mail Adress.. then i send you the Picture with Mail)
    http://img242.imageshack.us/img242/7934/crm.jpg
    This seems to be a searchfield from CRM (i am not fimilar with CRM)
    I changed the whole portal from BLUE to GRAY but this field is already blue... did somebody have a clue where i can change the color of this field?
    Regards
    Bjoern

    Bjoern,
    check these links
    http://help.sap.com/saphelp_crm60/helpdata/en/4d/2ae3f79e1d49d9be306f7768d55fba/frameset.htm
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/206cd953-41cf-2b10-7dbc-8a4d36664de5
    Thanks
    Bala Duvvuri

  • Changing size of image in ACR mode

    Have just bought Elements 12. When editing image in raw mode I cannot change size of image using ALT in combination with the mouse scroll  button like I could in Elements 8. Clicking plus and minus signs is clumsy and slower

    I believe that was removed in acr starting with the late 6.x or 7.x series and not sure why.
    One way to zoom quicker with the zoom in (plus) is to drag a box on the image, although that doesn't work for zooming out (minus).
    You can also right click on the image to get a menu with different zoom values (viewing percents).

Maybe you are looking for

  • Windows Vista installation prolem.. keypad not working at that time

    I'm a MacBook user having a Windows XP Sp2 with Mac OS X Leopard 10.5. Now I want to upgrade 'Windows Vista' from win XP. But when i start my Mac by inserting Windows Vista bootable Cd (holding "options" on key board -> and selecting the Win Vista Cd

  • How do I reformat a macbook air to original factory settings?

    I am trying to reformat my macbook air to original factory settings. I don't need to use any of the files currently on the HD, so just a clean wipe is all I need. Can anyone help?

  • Encountered an error...

    This keeps popping up and closing down the program.  I have no idea how to stop its occurrence.  Any help/advice would be greatly appreciated! premiere pro has encountered an error [/skinner64/shared/adobe/mediacore/backend/make/mac/../../src/clip/ma

  • Record missing in file in Proxy to file interface

    I am using proxy to file , in which i am using i have header , header_tax, and line, everything is fine , even i have checked the mesage monitoriing and component monitoring , i am getting all the data. but in the file generated i am getting only one

  • Capitalization errors in iTunes 7.2 Cover Flow view

    iTunes 7.2 running under OS X 10.4.9 on MBP. Today I ripped a brand new cd to iTunes and two very strange things happened. One is that after ripping, I downloaded the cover art from iTunes and then decided to erase the downloaded artwork, but it stil