Displaying a temporary image over another image

Hello,
I am writing a program where I need to draw a filled rectangle over another image then disappear (without drawing on to it).
The Image is on a JPanel.
Obviously I can not use Graphics.drawImage because that will permantley draw the rectangle on the image.
How can I achieve what I want to do here?
Thanks
Andrew

Yes, Ill be more specific.
I have an image and over the image there are two words: "photos" "videos".
I want to do the following: when you scroll the mouse on top of the word "photos", the word "photos" gets underlined and you can click on it and it will have a link to another page.
Now, I normally insert an "imagen de sustitucion" which i think is a substitute image and it works perfectly. But then I cant move that image to be ON TOP of the picture i want to use as a kind of backround to these words.

Similar Messages

  • How to add an Image layered over another Image?

    In our application, we display a big image file in the main application window.
    Now, we want to display customer's image(like their logo etc.,) just layered over main image on the top-left corner, restricted in size.
    Tried to visualize it !
    |------| |
    | |
    | |
    Is it possible to show a JLabel over another JLabel?

    Solution 1:
    JLabel is a container, So you can add any component on top of JLabel but normally it will not display but if you set any layout then you can see the added component.
        public static void solution1() {
         JFrame frame = new JFrame();
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         JLabel bigImg = new JLabel(new ImageIcon("F:\\tmp\\bigImg.jpg"));
         JLabel logo = new JLabel(new ImageIcon("F:\\tmp\\logo.gif"));
         frame.getContentPane().add(bigImg, BorderLayout.CENTER);
         bigImg.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
         bigImg.add(logo);
         frame.pack();
         frame.setVisible(true);
        }Disadvantage : if the label size was changed depends on the layout the position of the logo goes outside of the big image(in the above example maximize the window to see that issue).
    Solution 2:
    draw the logo image on top of the big image.
        public static void solution2() {
         JFrame frame = new JFrame();
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         ImageIcon bigImg = new ImageIcon("F:\\tmp\\bigImg.jpg");
         ImageIcon logo = new ImageIcon("F:\\tmp\\logo.gif");
         int w = bigImg.getIconWidth();
         int h = bigImg.getIconHeight();
         BufferedImage bf = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
         Graphics2D g2d = bf.createGraphics();
         g2d.drawImage(bigImg.getImage(), 0, 0, frame);
         g2d.drawImage(logo.getImage(), 0, 0, frame);
         JLabel label = new JLabel(new ImageIcon(bf));
         frame.getContentPane().add(label, BorderLayout.CENTER);
         frame.pack();
         frame.setVisible(true);
        }Advantage : whenever the label component size changed the logo must be on the big image of the same position because the logo was painted on top of the big image.

  • Can I insert an image over another image?

    Hi there,
    I currently have a "contact me" hotspot link set up in the header of my web page
    that takes visiter to my contact page.
    I would like the button area to display a slightly lighter version of  the button
    when it is hovered.
    Is there a way to insert an image with this rollover function over another image?
    Here is link to images in question.
    Thanks for any help that you can offer!
    RC/DG

    rcshell wrote:
    Hi there,
    I currently have a "contact me" hotspot link set up in the header of my web page
    that takes visiter to my contact page.
    I would like the button area to display a slightly lighter version of  the button
    when it is hovered.
    Is there a way to insert an image with this rollover function over another image?
    Here is link to images in question.
    Thanks for any help that you can offer!
    RC/DG
    Seriously the best way to do that is using a css background image on an 'anchor' tag. When you hover over the anchor tag the background image is swapped to a lighter one.
    #header a {
    background-image: url(pathToYourBgImage);
    backround-repeat: no-repeat;
    #header a:hover: url(pathToYourBgHoverImage);

  • How to add an image over another using af:image

    How to add an image over another using af:image
    Thanks,
    Veera

    i have a image which is black strip. i have added that to af:image
    <af:image source="image1" id="image" />
    on the black strip, i need to add company logo.
    how to achieve it.
    Thanks,
    Veera.

  • How do I superimpose one image over another

    How do I super impose one image over another?

    Open image A
    Open image B
    On image B, use one of the selection tools, e.g. selection brush, lasso tool, to select the object which you wish to "superimpose"
    Go to Edit menu>copy to put the object on the clipboard
    Go back to image A
    Go to Edit>paste. The object will be on its own layer
    Get the move tool out of the toolbox, and position the object and resize, if indicated

  • RoboHelp 8 HTML WebHelp How to display a larger image of a thumbnail by clicking on or rolling over the thumbnail?

    How would you display a larger image of a thumbnail by clicking or rolling over the thumbnail?

    Hi there
    For a mouseover you would have to add some custom developed JavaScript. You could probably find some pre-made on the web if you poked around.
    Generally speaking, any way you slice it you will be using two images. One for the thumbnail and one for the full sized image. You could employ the popup functionalty to pop up the larger image.
    I used to simply create DHTML drop-downs and insert the large images in the drop-down area.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Mouse cursor moving mask over another image.

    Hi, Is it possible to have where the Mouse cursor is on the page moving mask over another image. Imagine a black screen with a star cut out of the middle(where the cursor is) and u can see the image behind.
    Any examples on how to do this?
    Can it be done in html instead?

    Create the mask and the background as movieclips and then assign the mask as the mask property of the bacground movieclip... as in background.mask = msk (where msk is the instance name of the mask).
    Then assign a MOUSE_MOVE event listener to the mask and in the event handler for that listener have its x and y properties assigned to be the mouseX and mouseY properties

  • Display text and image over Video Image in applet

    Hi
    I am working in JMF for a video applet.
    I have a doubt ,how we can display text and image over Video Image.
    Is anybody know how we can draw text over Video Image,pls sent a small code how can do it in applet?.
    I can do it in a frame,but it not work in a applet !
    CHT

    it is very much possible in a htmlb:button.
    its same as how you have done it in xhtmlb:toolbarButton
    working code
            <%
      data image type   ref to cl_htmlb_image.
      data: image_string type string.
      create object image.
      image->id = 'IEX'.
      image->src = cl_bsp_mimes=>sap_icon( 'ICON_EXECUTE_OBJECT' ).
      image->tooltip = 'Find the Link'.
      clear image_string.
      image_string = image->IF_BSP_BEE~RENDER_TO_STRING( page_context ).
              %>
              <htmlb:button id     = "EX"
                            text   = "<%= image_string %> Execute"
                            encode = "FALSE"
                            onClick = "EXECUTE"/>
    Regards
    Raja

  • Placing one image over another

    How can I place one image over another image in java?

    Draw the bottom image first and then the top image. You would need to extend JComponent's paintComponent() method.

  • Overlay one image over another one.

    Hi,
    I am trying to overlay one image over another one.
    (example ..
    First images 1) This will have complete picture like the passport picture with background
    Second Image 2) This will have some specific parts(background of above) whitened
    Result picture 3) This should have the passport picture with out any background just the person.
    Is this possible using intermedia ??
    Thanks in advance.

    dude, not too sure the dept. of homeland security is going to be cool with doing that.
    unless you can make me a passport from Guam.

  • Displaying the .png image stored in an byte array

    Hi,
    I have to download an .png image from a server and i have to store it in a byte array and i have to display this byte array in another servlet. I have written the code to get the image from the remote server in a java class. The java class returns the byte array of the image and i have to display that in an servlet.
    If anybody has the code or any refrence to refer please help me..
    Thanks & Regards
    -Sandeep

    I have pasted code for servlet's doGet method which writes image data...
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws
    ServletException, IOException
    HttpSession session = request.getSession(); //taking httpsession
    response.setContentType("image/jpeg");
    ServletOutputStream out = response.getOutputStream(); //taking outputstream of response
    if (rtn.getErrorCode() == 0)
    //this will actually write image file data from where it is being called
    //byte array will contain image data, please load your image into below byte array variable
    byte[] b = new byte[100];
    out.write(b);
    out = null; //making null
    session = null; //making null
    In other servlet, write <img> tag and specify its src attribute to the "name of servlet where u have pasted above code" ..
    Regards,
    Nikhil

  • Safari not displaying web site image

    I have a website that is suddenly not displaying the header image in Safari and IE5.2.
    I have my suspicions that it is due to a JavaScript from Google to run their Analytics programme which I installed a few days ago, (and will shortly remove it to confirm the suspicion or otherwise.)
    But first I wish to check if other people are experiencing the same problem, or if it is localized to my computer. (Need to be able to inform Google if their script is the fault and affects all Safari users or only some versions. So please check the site and report results here, including your Safari version. Mine is Safari 1.3.2 (v312.6) and Internet Explorer 5.2 for Mac.
    The site is http://www.paintmaking.com
    What I see in Firefox, Netscape, Opera, and Camino is a flash title over a colored background with a photo.
    Thats what I saw in Safari until recently too. But suddenly all I now see in Safari and IE is the flash title over a gray background, no photo, and above the menu bar a very thin strip of color (about 1mm, 1/16in). The sidebar images are unaffected (and those images at the side work fine in all the browsers), it is just the header.
    Can you please tell me what you see and the browser version?
    Tony

    Thank you to everyone who has reported what you are seeing on my website. Now I need some help to troubleshoot the problem. So far I am confused as to where the problem lays let alone what the problem might be.
    I need guidance as I am running out of ideas for troubleshooting. Are there any files that I should try trashing?
    Could the problem lie in my Flash player perhaps (how do I test this?
    Updates:
    I can see only a gray color behind my flash title on http://www.paintmaking.com in Safari 1.3.2 (v312.6) and Internet Explorer 5.2.3 (5815.1). What should be there is a colored header image.
    I have established that other people can see the image correctly, including on the same builds of Safari and IE and on the same OS (10.3.9). An exception is someone using Shiira who can only see gray in Shiira, but sees colors in other browsers including Safari.
    On my computer Netscape 7.2, Firefox, Mozilla, Opera and Camino can all see the image correctly.
    Safari and IE have the same problem displaying the image on all the accounts on my eMac.
    I have: cleared cache with no improvement, checked Safari Preferences (Java enabled, JavaScript enabled, and 'display images as pages open' is checked.
    I have removed the software that I installed recently. (MacTracker)
    I have removed a piece of JavaScript added recently (from Google to facilitate their Analytics programme)
    The only major thing I have done lately that is out of the ordinary is to Clone my OS X hard drive to an external drive using SuperDuper.
    I don't seem to be having problems with other websites.
    So how can this be? If the problem is in my computer why only the one site affected? (I checked several sites) Yet if the problem is with the site then why can other people see the site correctly?
    (A very puzzled) Tony.
    eMac + iBook 12 inch (10.3.9 on both)   Mac OS X (10.3.9)   PowerPC G4 1 GHz 1 GB SDRAM + (iBook) PowerPC G3 500 MHz 384 MHz SDRAM

  • Display byte array image or ole object in Section through dynamic code?

    To Start I am a Complete Newbe to Crystal Reports. I have taken over a project originally written in VS2003 asp.net using SQL Server 2005 and older version of Crytal Reports. I have moved project to VS2010 and Cryatal Reports 10 still using SQL Server 2005. Have multiple reports (14 to be exact) that display data currently being pulled from database suing a dataset, each report has from 4 to 14 Sections. I have modified database table with two new fields. Field1 contains string data with full path to a scanned document (pdf or jpeg). Field2 holds a byte array of the actual image of the scanned document. I have tested the database and it does infact contain the byte array and can display the image via VB.net code. I can make the report display the scanned image using ole object.
    Now my real question: I need to add a new Section and it should display either the byte array of the scanned image or the actual scanned image (pdf or jpeg) . How can I have it do either of these options via code dynamicly while application is running?

    First; only CRVS2010 is supported on VS2010. You can download CRVS2010 from here;
    SAP Crystal Reports, developer version for Microsoft Visual Studio: Updates & Runtime Downloads
    Developer Help files are here:
    Report Application Server .NET API Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_api_en.zip
    Report Application Server .NET SDK Developer Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_dg_en.zip
    SAP Crystal Reports .NET API Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_api_2010_en.zip
    SAP Crystal Reports .NET SDK Developer Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip
    To add the images, you have a number of options re. how to. You even have two SDKs that y ou can use (RAS and CR).
    Perhaps the best place to start is with KB [1296803 - How to add an image to a report using the Crystal Reports .NET InProc RAS SDK|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233393336333833303333%7D.do]. The KB describes how to add images to a report using the InProc RAS SDK, but also references other KBs that use CR SDK.
    Also, don't forget to use the search box in the top right corner of this web page.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • DNGs produced from Hasselblad .fff files display a different image in Bridge and Camera Raw

    Lately, not sure when this started exactly, Bridge CC (and Camera RAW 8.7) are displaying incorrect DNG images!  Instead of showing the image I expect to see, I'll see an old image from days ago.  This seems to carry on from Bridge through to Camera RAW.  But then if I continue on to Photoshop with the image, it'll finally show the correct image. 
    I'm assuming this has something to do with DNG, because if I load another raw file type (like .fff or .NEF), it seems ok.  Also it seems to be ok with DNGs produced from other cameras like Nikon D90.
    My set up:
    - Mac OS X 10.9.5 (Mavericks)
    - Bridge CC
    - Camera Raw 8.7
    - Photoshop CC 2014
    - Hasselblad H4D-50

    HI, I managed to fix the trouble by reinsatalling once again and running updates BEFORE opening bridge. It seemed that if I ran the update AFTER opening bridge I would get either an up to date status when checking for updates or I would get an install failure notice on all 4 updates that were trying to install. The updates were for camera raw, bridge and PS. I can't explain why but that helped a little. I also changed permissions on my whole user accnt to include read/write for all users. I can't say if this helped or not. I also had to go into my camera B/U files on a sepate HD and replace some of the CR folders I was using o nthe desktop. Still the CR files would not show a thumb nor a preview till I then went to each individual file inside that folder and purged the cashe for that file so it could repopulate the cashe yet again. This has been the strangest few days in PSCS6 history! Well my personal history. I will report back here if more quirks emerge. I would prefer quarks though....aloha, U

  • Displaying a larger image from a thumbnail [was: Question]

    I would like to display a larger image from a thumbnail inserted on the web page. I inserted a rollover image, used the thumbnail as the original and a larger and different jpeg image as the rollover image. However, when the mouse rolled over the thumbnail, the new rollover image (different then the original) was the same size as the original. Is there an easier way to display a larger image from a thumbnail? What am I doing wrong? Thanks
    [Subject line edited for clarity by moderator]

    Could you also provide a CSS solution to opening a non _self page that is the same size as the image displayed on the page.
    Not possible with pure CSS.  Sorry.  Your best option is to use one of the jQuery Lightbox scripts mentioned below.
    http://line25.com/articles/rounding-up-the-top-10-jquery-lightbox-scripts
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

Maybe you are looking for