Double image on mouse click

Hi captivators
I am editing a couple of demo slides. I have moved the
background images up about 10 pixels as the action takes place
right at the bottom of the screen. I have raised the mouse pointer
in line with the buttons and all works fine until the mouse shows a
click. When it clicks the old lower image appears on top of the new
one creating a double image. How do I avoid this happening?

Hi ntompkins
What sounds like is happening is that maybe you took what was
originally the background image, modified and reinserted as a
standard image? If so, you may wish to try right-clicking and
choosing "merge into background".
Assuming you either already tried that and it isn't working
or for some other reason it isn't working, you might try inserting
a blank slide, configuring the background with the image, then
select and copy all objects from the errant slide to the new.
Finally, delete the new slide and maybe adjust the mouse position.
Cheers... Rick

Similar Messages

  • Double value of mouse click

    hi, I am making a program in which I need to get the Double value of the point where I clicked on my JPanel. Is it possible to get the Double or float value of the point at which mouse click event occur.

    The mouse pointer is always exactly on one physical pixel, hence the integer coordinates are most accurate. You could pretend that the user means some other point (like the center of the pixel instead of the upper left corner) than the one s/he is pointing, that's your own business.
    You may actually lose accuracy when you cast the ints to doubles or floats.

  • Create image on mouse click

    Hello,
    I'm trying to create an applet that will have a dot (any color) appear when the mouse is clicked. Most places have examples of buttons, but I am having a tough time figuring this one out.
    Thanks,
    -Rain

    Hi,
    you have to divide the process into several steps:
    get the image tag at the caret position
    read it' properties
    bring up a window with ooptions to change those properties
    remove the existing image tag
    place a new image tag with the new properties at the caret position
    alternately you can change the properties of the existing image tag.
    There a reloads of threads in this forum about how to change tag properties or the tag structure of a HTML document, so I omit this. Please try to do a search for such topics in this forum.
    A GUI (Java classes ImageDialog and ImagePreview) for entering image properties is available at http://www.calcom.de/eng/dev/index.htm
    Directly changing a table's width with the mouse is more complex, because you'd have to constantly write new width properties for the table and update the document while the mouse is moved. Probably better would be to bring up a dialog window to change the table properties instead.
    Hope this helps
    Ulrich

  • Inserting an Image on mouse clicked HELP

    Hi.
    I', trying to make a Tic tac toe game(if you do not understand please run this programme).
    The thing I want to happen is:
    the user clicks over a "sqare" and when mouse is released the image (X or O) appears on that position.
    I can't get my programme to do this.
    I'm using the MouseListener Interface to implement the mouse events, but when, for example, I click on one square no image is loaded on that position. what can I do?
    Here's my code.
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    public class Gato extends JFrame implements MouseListener{
         Container content = getContentPane();
         JTextArea texto = new JTextArea(1,150);
         Graphics2D g2d;
         Image cruz = Toolkit.getDefaultToolkit().getImage("cruz.gif");
         Image bola = Toolkit.getDefaultToolkit().getImage("bola.gif");
         public static void main(String [] coms){
              new Gato();
         public Gato(){
              content.add(texto, BorderLayout.SOUTH);
    setSize(300,300);
    setVisible(true);
    setResizable(false);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    addMouseListener(this);
         public void paint(Graphics g){
              g2d = (Graphics2D)g;
              g2d.draw3DRect(100,50,1,200,true);
              g2d.draw3DRect(175,50,1,200,true);
              g2d.draw3DRect(35,111,200,1,true);
              g2d.draw3DRect(35,177,200,1,true);
              int x = 3;
              int y = 25;
              g2d.drawImage(cruz, x, y, this);
              x = 260;
              g2d.drawImage(bola, x, y, this);
         public void pon(int x, int y){
              g2d.drawImage(cruz, x, y, this);
         public void mousePressed(MouseEvent e){}
         public void mouseClicked(MouseEvent e){}
         public void mouseReleased(MouseEvent e){
              texto.append(" " + e.getX());
    pon(e.getX(),e.getY());
         public void mouseEntered(MouseEvent e){}
         public void mouseExited(MouseEvent e){}
    }

    Look at this:
    import java.awt.*;
    import java.awt.event.*;
    import java.math.*;
    public class TicTac extends Frame implements ActionListener
         Button   bx[]  = new Button[9];
         int      used;
         Font     f1    = new Font("System " , 1, 28);
         MenuItem ng    = new MenuItem("New Game");
    public TicTac() 
         super(" TicTacTo ");   
         setLayout(new GridLayout(3,3));
         addWindowListener(new WindowAdapter()
         {     public void windowClosing(WindowEvent ev)
              {     dispose();
                   System.exit(0);
         setBounds(60,60,159,179);
         for (int b = 0; b < bx.length; b++)
              bx[b] = new Button("");
              bx.setFont(f1);
              bx[b].setSize(50,50);
    bx[b].addActionListener(this);
         add(bx[b]);
         MenuBar mb = new MenuBar();
         Menu mm = new Menu("Option");
         ng.addActionListener(this);
         mb.add(mm);
         mm.add(ng);
         setMenuBar(mb);
         newboard();
         setVisible(true);
    public void newboard()
         for (int b = 0; b < bx.length; b++)
              bx[b].setLabel(".");
              bx[b].setEnabled(true);
         used = 0;
    public void actionPerformed(ActionEvent be)
         if (be.getSource() == ng)
              newboard();
              return;
         Button but = (Button)be.getSource();
         but.setLabel("X");
         but.setEnabled(false);
         used++;
         if (used != bx.length) Oplay();
    public synchronized void Oplay()
         int n = (int)(Math.random()*9);
         while (!bx[n].isEnabled()) n = (int)(Math.random()*9);
         bx[n].setLabel("O");
         bx[n].setEnabled(false);
         used++;
    public static void main (String[] args)
         new TicTac();

  • Manipulating an image on mouse click

    I've been tinkering with some code I found here:
    http://java.sun.com/docs/books/tutorial/uiswing/painting/example-swing/CoordinatesDemo.java
    It basically paints a dot on the point where the mouse is clicked.
    I've been trying to alter this by adding an image into the pane - my goal being that the dot would appear on top of the image. However the dot is still being painted behind the image and so it's not visible.
    Any ideas on this? I'm completely stumped. Thanks folks.

    That's normal.
    Every child of the panel is painted AFTER the paintComponent
    procedure is called, so that it overlaps the component background.
    Perhaps you should create your own image component that paints
    yout dot after having displayed the image, or you can overlap
    a trasparent (Jpanel derived) component over the image component
    and draw in its own paintComponent.
    For more info, read the chapter
    Creating an Gui with JFC-Swing/Swing features and Concepts/Painting,
    in the Java Tutorial.
    Regards
    Maurizio

  • Change images on mouse click

    hi,
    cud anyone help me to change image in a JPanel in JFrame.On MouseClick event. the image should in an panel on mouseclick,plz explain with example source code.
    thank u

    I dvlp MyPanel to accept 2 image file name.
    You can easy change to accept Image instead of file name.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class Test {
    public static void main(String args[]) {
    JFrame f = new JFrame("Test");
    MyPanel p = new MyPanel("YourFirstImage.gif", "YourSecondImage.gif");
    p.add(new JButton("Click on Panel (not Button)"));
    f.setContentPane(p);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.pack();
    f.setVisible(true);
    class MyPanel extends JPanel implements MouseListener {
    Image image, image1, image2;
    public MyPanel(String image1Name, String image2Name) {
    //load image
    try {
    image1 = getToolkit().getImage(getClass().getResource(image1Name));
    image2 = getToolkit().getImage(getClass().getResource(image2Name));
    MediaTracker mt = new MediaTracker(this);
    mt.addImage(image1, 0);
    mt.addImage(image2, 0);
    mt.waitForAll();
    } catch (Exception e) { e.printStackTrace(); }
    this.image1 = image1;
    this.image2 = image2;
    this.image = image1;
    this.addMouseListener(this);
    public void paintComponent(Graphics g) {
    g.drawImage(image, 0, 0, this.getWidth(), this.getHeight(), this);
    public void mouseClicked(MouseEvent e){
    image = (image == image1) ? image2 : image1; // switch between image1, image2
    repaint();
    public Dimension getPreferredSize() {
    Dimension dim = super.getPreferredSize();
    int w = Math.max(image1.getWidth(this), image2.getWidth(this));
    int h = Math.max(image1.getHeight(this), image2.getHeight(this));
    w = Math.max(dim.width, w);
    h = Math.max(dim.height, h);
    return new Dimension(w, h);
    public void mouseEntered(MouseEvent e) {}
    public void mouseExited(MouseEvent e) {}
    public void mousePressed(MouseEvent e) {}
    public void mouseReleased(MouseEvent e) {}

  • Unable to select an image with right click of the mouse

    When in Library mode using grid view, right clicking on a thumbnail does not select the thumbnail, and previously selected items remain selected. If you then try to delete the item, you can inadvertently delete multiple items that you did not intend to delete and not the item you wanted to delete.
    Right clicking on an already selected image or one of a group of selected images works and all selected images can be deleted. However a right click on a non selected image should should drop any current selections and select only the image clicked. (This can be verified in Bridge)
    I am using Lightroom 1.3.1 in Windows XP SP2 with 2 gig of ram.

    Have you switched your mouse buttons i.e have you changed assignments to your mouse buttons in the control panel?
    If not, then clicking on an image will select it, CTRL-Click will select non-contiguous images, SHIFT-Click will select contiguous images.
    Right-clicking will show a context menu. (and the context menu will change if you have single multiple images selected: e.g if you select two images you will see a menu item Open in Compare that is not there if only a single image is selected, Delete Photo... becomes Delete Photos... etc)
    Also, in grid or filmstrip view you will see up to three levels of brightness on the frames around thumbnails:
    -lightest frame: the active image i.e. the one that will be opened if you go to develop mode, or will be used as "source" for synchronize command etc
    -medium: other images that you have selected.
    -darkest: images that are not selected.
    Selected images will also have a white frame immediately around the thumbnail.

  • Mouse clicks inside image in applet

    How can I respond to mouse clicks inside particular regions in an image loaded as part of an applet in a browser? ie, I want to send these clicks onto the server for the server to handle it and the server should change the image according to the mouse clicks.
    Thanks,

    /*  <applet code="ImageMouse" width="400" height="400"></applet>
    *  use: >appletviewer ImageMouse.java
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.net.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class ImageMouse extends JApplet
        JLabel label;
        public void init()
            ImageMousePanel panel = new ImageMousePanel();
            ImageMouser mouser = new ImageMouser(panel, this);
            panel.addMouseMotionListener(mouser);
            getContentPane().add(panel);
            getContentPane().add(getLabel(), "South");
        private JLabel getLabel()
            label = new JLabel(" ");
            label.setHorizontalAlignment(JLabel.CENTER);
            label.setBorder(BorderFactory.createTitledBorder("image coordinates"));
            Dimension d = label.getPreferredSize();
            d.height = 35;
            label.setPreferredSize(d);
            return label;
        public static void main(String[] args)
            JApplet applet = new ImageMouse();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(applet);
            f.setSize(400,400);
            f.setLocation(200,200);
            applet.init();
            f.setVisible(true);
    class ImageMousePanel extends JPanel
        BufferedImage image;
        Rectangle r;
        public ImageMousePanel()
            loadImage();
            r = new Rectangle(getPreferredSize());
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int w = getWidth();
            int h = getHeight();
            int imageWidth = image.getWidth();
            int imageHeight = image.getHeight();
            r.x = (w - imageWidth)/2;
            r.y = (h - imageHeight)/2;
            g2.drawImage(image, r.x, r.y, this);
            //g2.setPaint(Color.red);
            //g2.draw(r);
        public Dimension getPreferredSize()
            return new Dimension(image.getWidth(), image.getHeight());
        private void loadImage()
            String s = "images/greathornedowl.jpg";
            try
                URL url = getClass().getResource(s);
                image = ImageIO.read(url);
            catch(MalformedURLException mue)
                System.err.println("url: " + mue.getMessage());
            catch(IOException ioe)
                System.err.println("read: " + ioe.getMessage());
    class ImageMouser extends MouseMotionAdapter
        ImageMousePanel panel;
        ImageMouse applet;
        boolean outsideImage;
        public ImageMouser(ImageMousePanel imp, ImageMouse applet)
            panel = imp;
            this.applet = applet;
            outsideImage = true;
        public void mouseMoved(MouseEvent e)
            Point p = e.getPoint();
            if(panel.r.contains(p))
                int x = p.x - panel.r.x;
                int y = p.y - panel.r.y;
                applet.label.setText("x = " + x + "  y = " + y);
                if(outsideImage)
                    outsideImage = false;
            else if(!outsideImage)
                outsideImage = true;
                applet.label.setText("outside image");
    }

  • Figuring out where a mouse click is under an image

    I want to create a JFrame (or JPanel) where the whole area is one big gif (or icon etc) and I want to make some areas of this panel react to mouse clicks and other areas display messages.
    There are two ways that I can think of doing this.
    The first is that I figure out the x and y coordinates of each area and check to see if each mouse click is within that area.
    The second way is to see if I can figure out how to put something like transparent JButtons over the areas that I want to accept mouse clicks (all the areas will be rectangular) and just do what JButtons do normally.
    The second way sounds easier but I don't know how to do that.
    Does anyone have opinions on which way I should do it?
    Thanks

    To me the first method sounds eaiser.
    A third possible idea? Add a bunch of JPanels to the frame and have split the image into several pieces that are painted by each JPanel. Then use a mouse listener to detect clicks. (Seems easier than trying to make JButton transparent and placing it at the correct point).

  • Capture right mouse click in image

    I would like to capture a right mouse click while pointing into am image window.
    So far I've come only to the possibilty to capture events that originate somehow with the left mouse click.
    Or
    Are specific to the front panel of the currently active VI
    Or
    Detect whether at the time of calling a subVI the button is down or up, with all the usual hazzel of detecting the transition (plus the necessity of depending on MS Driect X).
    What I would like to have is a signal that describes the right click in an image window.
    Thanks for any ideas
    Gabi
    7.1 -- 2013
    CLA

    Hi,
    If you use LV7, you can use the event structure. Add an event or filter
    event "Mouse down" for the picture. The "button" value indicates 2 for the
    right button, 1 for the left.
    Regards,
    Wiebe.
    the picture control has a property "Mouse". This is a cluster, that includes
    "Gabriela Tillmann" wrote in message
    news:[email protected]..
    > I would like to capture a right mouse click while pointing into am
    > image window.
    > So far I've come only to the possibilty to capture events that
    > originate somehow with the left mouse click.
    > Or
    > Are specific to the front panel of the currently active VI
    > Or
    > Detect whether at the time of calling a subVI the button is down or
    > up, with all the usual hazzel of det
    ecting the transition (plus the
    > necessity of depending on MS Driect X).
    >
    > What I would like to have is a signal that describes the right click
    > in an image window.
    >
    > Thanks for any ideas
    > Gabi

  • Can't Download Images with Right-Click on Mouse

    I can't download images by right-clicking my mouse, like I do on my PC. For example, check out http://en.wikipedia.org/wiki/North_Dakota and look at the images of the flag, state seal and map near the top right corner of the page...
    When I place my cursor over any of these images on either my PC or my MacBook Pro, my cursor changes to a hand, indicating that the images are hyperlinked. If I right-click on an image, I can choose a SAVE AS command on my PC, but nothing happens on my MacBook Pro.
    If I left-click on a linked image, it simply zooms in, rather than taking me to another page. I'm using a small Kensington mouse.
    This could be a Firefox problem. I think I recall downloading some sort of extension that allows you to zoom in on images, and I suspect it's more or less taken over. If so, I'll have to track down the name of the extension and try and zap it.
    But I thought I'd check here first, just to see if other people have this same problem - or if you can suggest alternate strategies for downloading images.
    Thanks.

    Well, I found a novel solution - it's called Safari.
    I'll post on the Firefox forum to figure out why I
    can't download images with it, but it seems to work
    just fine with Apple's native browser. Thanks for all
    the tips.
    I just tried it, but I am using firefox 2.0 beta and I had no problems. Not sure what's going on. Have you tried any other pages or pics besides this one, which I don't think it would matter just wondering.

  • Using mouse click to return image coordinates.

    Ok so I've been trying to figure out how to do this and it seems very complicated for something that really seems straightforward.
    Anyway. I have a camera that updates an image object on the front panel using a while loop. I have another image object that is updated with a still image when the "snap" button is pressed. Now what I want to do is to click on a point in the snapped image and have the VI return the coordinates of that pixel in the image coordinate frame.
    What I've got so far is an event structure in the while loop with the following to occur in the event "image object -> mouse down":
    Server reference (reference to the image object) -> Property node (last mouse position) -> output screen coordinates.
    I've got two errors that don't make a whole lot of sense to me (I haven't worked with event structures before): "event data node contains unwired or bad terminal" and "event structure one or more event cases have no events defined". This second one seems strange since I don't actually want anything to happen if there's no mouse click. The first one seems to refer to the element box on the left hand side of the event structure.
    The above is my lastest attmpt at sorting this problem and as far as I can see it should work. whatever about the errors, am I even taking the right approach with this? I'd have thought image cordinates would be a common enough thing but search the boards here, it would appear not...
    Kinda stumped here. Any help is much appreciated.
    Message Edited by RoBoTzRaWsUm on 04-14-2009 08:34 AM
    Solved!
    Go to Solution.

    Hello RoBoTzRaWsUm,
    I have taken a look at your VI, which has been taking a correct approach to the data you are looking for.  As you are using and event structure, you should be looking for an event to occur.  When using a Property Node, you are trying read an attribute of a control.  However, in an Event Structure, I believe you should be using an Invoke Node.  An Invoke Node allows your to read an event or write a method with the Control Class in LabVIEW. 
    1. Place down and Invoke Node from the Functions Palette in 'Programming'->'Application Control'
    2. Wire your Image Control reference to it
    3. Click Method, and select 'Get Last Event'
    4. Right click on 'Which Events' and 'Create Constant'.  Make the constant '1' in the array
    5. Read the 'Coordinates' Cluster from the left hand side of the Event Case by right clicking  and 'Create Indicator'
    You will find a piece of example code attached.
    Regards
    George T.
    Applications Engineering Specialist
    National Instruments UK and Ireland
    Attachments:
    UKSupportMouseClick.vi ‏39 KB

  • Distinguishing b/t two single mouse-click and mouse-double-click

    Hi,
    I am curious to find out how Forms will distinguish between two single when-mouse-click events and a single when-mouse-doubleclick event. Is it simply a timing issue or is there more involved i.e. the 'co-ordinates' of the mouse. Thanks in advance for any opinions given,
    regards,
    Kevin.

    The difference is same as the difference of Apple and Orange.
    Its depends on O/S and event management within OS kernel.
    You can change the timing in Control panel of mouse double click.

  • Getting mouse click coordinates with image button

    I'm using ADF Rich Client components in JDeveloper 11g Technology preview.
    I have to get the mouse click coordinates with an image button. In the page I put something like this:
    <af:commandButton text="commandButton1" icon="ambiente.jpg"
    actionListener="#{prova.listen}" action="#{prova.esegui}" />
    In the listener method of the managed bean I try to get the coordinates with this code:
    public void listen(ActionEvent e)
    FacesContext context = FacesContext.getCurrentInstance();
    String clientId = e.getComponent().getClientId(context);
    Map requestParams =
    context.getExternalContext().getRequestParameterMap();
    int x =
    new Integer((String) requestParams.get(clientId + ".x")).intValue();
    int y =
    new Integer((String) requestParams.get(clientId + ".y")).intValue();
    but it doesn't work. It seems that there aren't in the request the coordinates of the image point clicked. Is it true? How can I do that with ADF ?

    Hi,
    the mouse position is not part of the request parameters send. You will have to use client side JavaScript for this
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document>
    <f:verbatim>
    <![CDATA[
    <script>
    function handleMouseCoordinates(event) {      
    alert("x: "+event.getPageX()+" y: "+event.getPageY());
    </script>
    ]]>
    </f:verbatim>
    <af:form>
    <af:commandButton text="My Click Button" icon="/images/jdev_cup.gif">
    <af:clientListener method="handleMouseCoordinates" type="click"/>
    </af:commandButton>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Frank

  • On right mouse click, there is no "save as" or "copy image" when I want to save a pictureon line. I have to go back to IE to access this option. Is this not available? Many thanks, Joy

    On right mouse click, there is no "save as" or "copy image" when I want to save a picture on line. I have to go back to IE to use this option. Is this not available? Many thanks, Joy
    There are so many occasions on line when I want to save an image that I can't believe I can't do so using Firefox, which I find so good in all other ways. I can Bookmark, save a page or send a link, but not take a simple copy image.

    Hi, Many thanks for replying, it's much appreciated. I started Firefox in safe mode and found I had the full right click menu on a pic on my home page. However, after moving around the web, I've found that the problem still occurs in eBay and it doesn't make any difference in safe mode. still no full menu. After returning to normal mode, I find that this still stands i.e. I do get the full menu on other sites but not in eBay. As I often want to save a pic in Ebay and can do so in IE, I'm baffled as to why this one site is giving problems. As this is where I've mostly been trying to save pics, I didn't realise that it was a "one site" problem and not applicable to everywhere else. If IE didn't work in this respect, I could blame the eBay site, but it does, so that just makes it more puzzling - and very annoying! I have tried accessing Ebay direct, rather than clicking on the toolbar, but this makes no difference. Any further thoughts would be much appreciated. Joy

Maybe you are looking for

  • IPhoto wants to RE-import some of my photos

    Hi, all: I've noticed something odd, the last two times I've imported photos from my Canon PowerShot 780 IS... iPhoto is re-importing (importing again, that is) a number of photos that are already in my library. I do not understand why this might be

  • Colors changed on preview

    Hello, I've been having a strange color issue with Photoshop CS3 (and Illustrator CS3).  I'll make a design or drawing in Photoshop or Illustrator, then save it as a jpg to email it off to my client for previewing using gmail.  In the gmail preview,

  • DEAD LINKS IN TECHNET FOR OO4O DOWNLOADS

    All links to download OO4O from http://technet.oracle.com/software/tech/windows/ole/content.html are dead. For example, clicking on the link to OO4O817315full.exe takes me to the terms page (�Oracle Technology Network Development and Distribution Lic

  • Downloaded disc 1 of elements 10; disc got stuck and cannot download remaining discs.

    Downloaded disc 1 of photoshop elements 10.  Disc got stuck in computer and download apparently timed out.  Program is installed, but I cannot install discs 2 and 3.  I'm not computer-literate, please respond accordingly.  thanks

  • What Fan Speeds Are Normal?

    My fan speeds are (in rpm): CPU-1800 HD-2200 OD-1300 Until I got the Sims 3, I didn't have a problem with the heat of my computer. But after I bought the game, I felt a need to download a fan control software to keep the temps down. I tried smcFanCon