How to Change the color of the black image

Hi,
I have created a black image. But want to insert some text and chnage the color of the same. I am trying to do it, by usign various classes of javax.imageio.*, java.awt.image. But, I have not the required output till now. I am showing my code below. The image I created is totally black.
Any suggestion greatly appreciated.
File f = new File("C:/tomcat5.5.15/apache-tomcat-5.5.16/webapps/plugintest/03974701.jpg");
BufferedImage image = ImageIO.read(f);
int height = image.getHeight();
int width = image.getWidth();
int type = image.getType();
ColorModel cm = image.getColorModel();
System.out.println("Width of the Image is "+width);
System.out.println("Height of the Image is "+height);
System.out.println("type of the Image is "+type);
BufferedImage image1 = new BufferedImage(width,height,type);
//image1.setRGB(45,45,rgb);
File f1 = new File("blank.jpg");
RenderedImage ri = image1;
ImageIO.write(ri,"jpg",f1);

Color c = new Color(0, 0, 0);
Graphics g = image1.getGraphics();
g.setColor(c);Thanks for your suggestion I added these lines to the
code(code is shown above), but the there is no change
in the color of the jpg image saved in the file. Am I
missing something.Yes.
a) Do you know what color 0,0,0 is? Hint: not mauve
b) When you call set color that sets the drawing colour. But you aren't drawing anything. You can draw things with the methods of Graphics and Graphics2D. I suggest starting with fillRect
http://java.sun.com/developer/Books/Graphics/
Thanks

Similar Messages

  • Software Project - how to change the logo Image

    Hi
    Downloaded and installed sample code - Software Project -
    how to change the logo Image,
    Please do the needfull,

    Hi,
    Go to
    Home>Application Builder>Application 144>Shared Components>Edit Application Definition->Logo
    Logo Type:
    choose Image
    type the path of your image in the text box.
    you have to upload your image inside Shared Components>images
    use
    #APP_IMAGES#YOURIMAGENAME.GIF
    thanks
    Mark Wyatt
    Edited by: Websoft on Oct 8, 2009 12:10 AM

  • How to change the branding image in logon page

    Hi All,
    I am customizing portal logon page.Can any body help me how to change the brandingimage in logon page.When i gone through the source code i couldnot find any webpath to include the brandimage.
    Thanks
    vinodh

    Hi,
    Check this:
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/fc3ae22adb025fe10000000a1553f7/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/52/4c6c3e58d0d064e10000000a114084/frameset.htm
    change the branding image of Portal
    Regards,
    Praveen Gudapati

  • How to change the button image in theme editor

    How can i change the button image in theme editor. If i upload another button image in theme editor it doesn't show me the full image. it cuts it from the right. how can i view  the full image as a button.
    Thanks

    HI,
      Check this link
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/ep/modifying%252bthe%252blogon%252bpage
    Custom logon page
    Portal Customizations Intro - Login Part 1
    Change the portal logon page image programmatically
    Branding
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a000df6b-586a-2910-e6be-9fee831d5a30
    Thanks,
    Gopi

  • How to change the flag image in language input in menu bar?

    I have two languages that I have selected for regular use in my language input menu (on the right-hand side of the menu bar), and I would like to change the Spanish input flag from the Spain national flag to an Argentina flag, just for aesthetics. I figured it'd kind of be like changing the image of how the HDD looks like on the GUI (control-click, get info, copy and paste image), but I'm not sure where to start or if it's even possible. Anyone have any clues or experience with this? I may just have to make do with keeping the Spanish flag up there but just for curiosity's sake I want to know if it can be done.

    There is no problem doing this if you are willing to create and install a custom keyboard layout.  You can find the tool and a manual at
    http://scripts.sil.org/ukelele

  • How I change the save image dialog box view from oldest to newest first as the default?

    My save image dialog box has the oldest file in the folder in the upper left position (using list). I want to change it to the newest file shown first. It used to be that way, but now it showing oldest first. I haven't found any guidance on defaults for this box. Thanks.

    Leave it to Apple.  When I first got the phone, that's the way they were configured.  Now that they've flipped around, there's now way to change it!

  • How to change the background image on IP Phone 8861

    Hi Concern,
    I face some problem on changing background image on IP Phone 8861. I prepare 
    .png file as per below doc.
    Full size image - 800 pixels (width) X 480 pixels (height).
    Thumbnail image - 159 pixels (width) X 109 pixels (height).
    http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cuipph/8811_8841_8851_8861/10_5/english/adminguide/P881_BK_A92A3B94_00_adminguide-8811_41_51_61-10_5/P881_BK_A92A3B94_00_adminguide-8811_41_51_61-10_5_chapter_01010.html#P881_RF_C8927D88_00
    I upload the png and List.xml on cucm 10.5 as per above doc.
    List.xml Example 
    <CiscoIPPhoneImageList>
    <ImageItem Image="TFTP:Desktops/800x480x24/TN-Fountain.png" URL="TFTP:Desktops/640x480x24/p1-800X480.png"/>
    <ImageItem Image="TFTP:Desktops/800x480x24/TN-FullMoon.png" URL="TFTP:Desktops/640x480x24/p2-159X109.png"/>
    </CiscoIPPhoneImageList>
    Now i go to phone set and check new background picture not shows it says "no wallpaper server" something like that. 
    Please help on the issue. 
    Thanks
    Afzal

    Hi Jaime,
    Thanks is done .. 
    On dx650 phone background change is same procedure or different.
    File size is different i know but list.xml is same or different ?
    Or i can upload only one list.xml file just line add for dx650 phone.
    Thanks
    Afzal 

  • How to change the colour of selected item in itemrenderer

    Hello guys
    please tell me how to change the selected image( which is in itemrender of tilelist).so that the colour sholud be shown within  image not its outer part due to renderer.
    Thanks in Advance
      vineet sharma

    Currently you cannot, it is a known (and hopefully reported, and at least addressed for next version) bug (or limitation, as they rushed to get the components out before JavaOne...).
    People reported they just put an empty text and put a label beside the component. Ugly workaround (bad when the component will be complete) but if it works... :-)

  • I just purchased the SX60 and have been trying to find the way to change the "startup image".

    I just purchased the SX60 and have been trying to find the way to change the "startup image". I have the SX40, Sx30 SX1 and all allow me to change the startup image and the sounds through MyCamera. When I opened MyCamera, it tells me that it won't work on my model. Does anyone know how to change the startup image? In the menu it gives me the choice to either have it on or off. Thanks so much!

    Looks like Canon has changed what they ship with the newer cameras. My SX50 came with a disc & no paper manual. Because of that I searched the Canon site (USA site) & found the program set you need to download (according to what it says). Now there are different versions based on your operating system so for my search I've chosen Win 8.0 & the program file recommended is
    File Description   Date Size
    Digital Camera Software 4.3 [Windows]
    09/16/14
    22.26 MB
    File Name: dcsw-4-3-0-2-9l.zi
    "A skill is developed through constant practice with a passion to improve, not bought."

  • Hi, I'm working on a document in PAges 09. Any idea on how to change the document color? I want it black instead of white.

    Hi, I'm working on a document in PAges 09. Any idea on how to change the document color? I want it black instead of white.

    Nichelle,
    You must add your own background object, and then make it Black.
    Insert > Shape > Rectangle
    In the Wrap Inspector, set to Floating.
    In the Graphic Inspector, set Stroke to None and set Fill to Black.
    Grab the corners of the document and stretch the document to cover the entire page.
    Back in the Wrap Inspector select "In Background".
    Format > Advanced > Move Object to Section Master.
    Regards,
    Jerry

  • I can't figure out how to change a color photo to grayscale/black in InDesign so that we can do a separation that keeps the photos only on the black separation.

    I can't figure out how to change a color photo to grayscale/black in InDesign so that we can do a separation that keeps the photos only on the black separation.

    Yes, I can view/hide the OSK with no problem but the keyboard, itself, changed somehow.

  • How to change the color of text but only when that text is highlighted

    I am NOT asking how to change the highlight color OR how to change the text color generally, but rather, how to change the text color as it shows onscreen while it is highlighted. Here's where I'm going:
    Text is ordinarily black (assume) such as when the Finder is open or when viewing a list of all emails in an inbox.
    Let's say I change the highlight color systemwide, in prefs > appearance > highlight color, to a custom color ("other") of black (for example).
    In certain programs (mail, billings, iBank, addressbook, even the Finder), when I highlight a line of something, (like when I one-click on an email or a file name just to select it but not open it), the line will highlight in black, but the text of that line will automatically change to white so it can be seen.
    However, when I highlight actual text (click and drag or double click), such as when editing a document in Pages and selecting a word, line, paragraph, editing an email, etc., the highlight is black, and the text remains black also, which means it cannot be seen (black on black).
    So, how do I change it so that when I highlight the actual text the text color changes to white, then when it is de-selected, it goes back to black.
    I'm not afraid to do a little terminal/command line, but only if it’s a little. Hope this gives enough detail.
    Thanks.

    You can use span HTML tag.
    For example, if your label is "Product Name", and you want it to appear in red, you can type this:
    <span style="color:red">Product Name</span>Hope it helps.
    Ravi

  • HoW to ChaNGE the text in the mobile application to be in MulTi-CoLoR text

    _*  Do anyone can tell me how to change the text in the mobile application to be in multi-color text, to make it more interesting and increase readability?
    Is it using the Graphic's paint() method? or any better suggestion?
    Please give the short example if can?
    Please help... "_"
    Hearing from u all soon...@_@
    thanks....

    Go into outline view. If you can see the outlines of the letterforms, you can't just change the text. If the letterforms are solid black, take the type tool, select the text and type yours.
    Anyway you can just select the letters, take the type tool and type new text.
    Working with the type tool is a basic. Please see the manual for details

  • How to change the selection background color of the selected item in the popup menu of the choice box ?

    How to change the selection background color of the selected item in the popup menu of the choice box ?
    By defaut, the selection background color likes "blue", but if I want it to be "yellow" for example, how should I do ?
    Thanks

    The id is applied by (I think) the skin class of the ChoiceBox. You don't need to define it.
    You have to apply the css in an external style sheet. You can apply the external style sheet to any parent of your choice box, or to the scene (the most usual way to do it).
    Example:
    import java.util.ArrayList;
    import java.util.List;
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class ChoiceBoxTest extends Application {
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Example 2");
        final ChoiceBox<String> choiceBox = new ChoiceBox<>();
        List<String> tempResult = new ArrayList<String>();
        for (int i = 0; i < 10; i++) {
          tempResult.add("Item " + i);
        choiceBox.getItems().setAll(tempResult);
        VBox root = new VBox();
        root.getChildren().add(choiceBox);
        final Scene scene = new Scene(root, 300, 250);
        scene.getStylesheets().add("choiceBox.css");
        primaryStage.setScene(scene);
        primaryStage.show();   
      public static void main(String[] args) {
        launch(args);
    choiceBox.css:
    @CHARSET "UTF-8";
    #choice-box-menu-item:focused  {
    -fx-background-color: yellow ;
    #choice-box-menu-item .label {
    -fx-text-fill: black ;
    Message was edited by: James_D

  • How to change the default color of the selected row

    hi all,
    I need to know how to change the default color(yellow) of the selected row in a table component.whether i need to change anything in the stylesheet.If so, where should i make the changes in the stylesheet.
    thanks and regards,
    rpk

    The chart colors are being referred to *'palette.cxml'* file in these directories
    BI_HOME\web\app\res\s_oracle10\chartsupport
    BI_HOME\oc4j_bi\j2ee\home\applications\analytics\analytics\res\s_oracle10\chartsupport
    you can change to your custom colors.
    Restart OC4J and PS to make the new ones work..
    Regards,
    Raghu

  • How to change the default hint box color?

    How to change the default hint box color on the default Metal LookAF?
    I'm trying looking for something with javax.swing.UIManager, but i just find ways to translate the UI.
    Any idea?

    [UIManager Defaults|http://www.camick.com/java/blog.html?name=uimanager-defaults] shows all the properties of the UIManager.
    Although there is no "hint box" component, so I don't know if it will help.

Maybe you are looking for

  • Ipod touch 3rd gen not syncing movies

    Today after about 4 years with the same movies on my Ipod touch third gen i decided to change what i had on my device. so i started up itunes for the first time in a few years pluged my device in and it connects no problem. i move all the movies i ha

  • My laptop won't turn on!!!

    Hi everyone, I left my laptop on hibernate and once I got back home it won't turn on I have a P55-A5200 laptop. What do I need to do?

  • How to interpret result of outcode method of Rectangle2D.Double class

    I am trying to use Rectangle2D to determine position of a point with respect to a given rectangle. Here is my code Rectangle2D.Double rect = new Rectangle2D.Double(10,10,50,50);           System.out.println(rect.outcode(10,10));           System.out.

  • Adding NEW field in CIC - IC-WEB

    Hi, I've added a new field to the view FollowUpDetails.htm, this is a Dropdown list field. I've created SET method and it is showing the value in the list and I an able to select the desired option from the list, but when I tried to SAVE the entry th

  • LR from CC, but asking for Serial Number! Pls help! URGENT!!!

    I have LR and PS as part of my Photography Subscription to Adobe CC. I was having a problem with LR, so I downloaded a trial version from the site and installed. Now LR asks me for a Serial Number when I run the software. I don't have a Serial Number