Using mouse to draw cicrle

hi,
cuold you tell me how to draw the circle by mouse on xy graph, but in this case the equation to generate cricle is not required. that mean i will change the xy graph from indicator to control status and draw on it.
sincerely,
Tung

tungu123 wrote:
first of all, i change the xy graph from "indicator" to "control" condition. after that i will draw the circles or lines on this graph.  but i do not know how to draw because xy graph is not allow to draw when it is "changed to control" condition.
I think you are not understading the basics of a graph. Changing a graph to a control does not magically turn it into a full featured drawing program.
Have a look at the above quoted examples. Basically you need some code to read mouse-down and mouse-move coordinates, map them to the graph scale, then generate the graph data. You can (and should) leave the graph as an indicator.
Open the example finder an look at example "draw graph with events". Let us know how far you get. Good luck!
Instead of a graph, you could also use a picture indicator.
If you have a newer LabVIEW version, you can use the "plot images" feature.
Message Edited by altenbach on 02-22-2007 11:14 PM
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Draw a line using mouse

    Hello there:
    I'm trying to draw a line using mouse pointer: My code is:
    public class DrawLine extends JFrame implements MouseListener, MouseMotionListener
        int x0, y0, x1, y1;  
        public DrawLine()
             addMouseListener(this);
             addMouseMotionListener(this);
        public void mouseDragged(MouseEvent e)
             x1 = e.getX();
             y1 = e.getY();
             repaint();
        public void mouseMoved(MouseEvent e) { }
        public void mouseClicked(MouseEvent e){ }
        public void mouseEntered(MouseEvent e) { }
        public void mouseExited (MouseEvent e) { }
        public void mousePressed(MouseEvent e)
              x0 = e.getX();
              y0 = e.getY();           
        public void mouseReleased(MouseEvent e)
              x1 = e.getX();
              y1 = e.getY();
       public void paint(Graphics g)
                 g.setColor(Color.BLACK);
              g.drawLine(x0, y0, x1, y1);
        public static void main(String[] argv)
             DrawLine dr=new DrawLine("Test");
             dr.setVisible(true);
             dr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }when mouse is dragged, multiple lines are being drawn....
    could you else please tell me what should I've to do???
    thanks n regards...
    Dev

    You can implement the listeners on any class, even one that (implicitly) extends Object. What matters is that the listener is added to the component that needs to use it.
    That said, why do you want to extend JFrame? Are you adding functionality to the JFrame to justify extending the JFC class? Note that extending JFrame allows the users of your class to access the functionality of a JFrame, is that really indicated here?
    one class that extends JFrame, and one can draw a line on JLabel, embedded within JFrame!So you still have to override paintComponent of the JLabel, which implies using an anonymous inner class.
    Starting with the example already posted, that would be:
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.SwingUtilities;
    public class DrawLineTest
        implements MouseListener, MouseMotionListener {
      JLabel label;
      int x0, y0, x1, y1;
      private void makeUI() {
        JFrame frame = new JFrame("DrawLineTest");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        label = new JLabel("FFFF") {
          public void paintComponent(Graphics g) {
            super.paintComponent(g);
            g.setColor(Color.BLACK);
            g.drawLine(x0, y0, x1, y1);
        label.setPreferredSize(new Dimension(500, 500));
        label.addMouseListener(this);
        label.addMouseMotionListener(this);
        frame.add(label);
        frame.pack();
        frame.setVisible(true);
      public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            new DrawLineTest().makeUI();
      public void mousePressed(MouseEvent e) {
        x0 = e.getX();
        y0 = e.getY();      
      public void mouseReleased(MouseEvent e) {
        x1 = e.getX();
        y1 = e.getY();
      public void mouseDragged(MouseEvent e) {
        x1 = e.getX();
        y1 = e.getY();
        label.repaint();
      public void mouseMoved(MouseEvent e) { }
      public void mouseClicked(MouseEvent e){ }
      public void mouseEntered(MouseEvent e) { }
      public void mouseExited (MouseEvent e) { }
    }Better spend more time with the tutorials, there's a separate section on writing event listeners.
    db

  • Free draw using Mouse & Save it???

    Hi
    I have an applet code using which we can free draw using mouse. Say you can sign or draw anything on screen in the space given. Now, How do I store it as an image. IF not as an image, are there any other way to store the image drawn using the mouse.

    Are you not drawing to an image anyway? If you don't then all your work will be lost if you minimize and restore the window.
    On creating your canvas component obtain an image via JComponent.createImage(). When drawing with the mouse, draw to a Graphics object which is obtained from that image via Image.getGraphics(). Then in your paintComponent() method, paint that image to the on-screen Graphics object.

  • Writing on the canvas using mouse

    Hi,
    In my application, i use mouse to write some text on a panel or canvas. The code works fine when i write slow on the panel or canvas, but if you started to write fast you miss some of the mouse events , so all i can get is dots, not a continuous line. That is my problem. How can i get around this problem. Any suggestions here
    thanks in advance

    Hi,
    I am developing a touch screen based application,
    where the user will be writing on the screen ( panel,
    canvas ) using mouse or the touch screen pen. I need
    to save what he draws on the panel or canvas to a jpg,
    jpeg, gif file. The image i stored will used later.
    So i need help to convert the drawing on the panel or
    canvas into a image. Any suggestions in this regard
    is appreciated.
    thanks in advanceFirst of all, your app sounds cool! Second, there are literally hundreds of posts, just like this one, that have been answered more times than I can count. Just do 2 searches in the forums:
    1. how to capture a gui component into an image format
    2. how to save an image as a jpg

  • How to use Mouse Wheel Events

    Hello Everyone
    I am using Datagrid in my Canvas.
    I use mouse wheel to scroll the datagrid. But in one scroll
    through that wheel make the more than 4 rows to be scroll.
    So Now my requirement is to control the delta value of mouse
    wheel event and how to use that with my datagrid so that i will
    able to scroll one row through mouse wheel scroller.
    Thanks

    please give me some suggestion around it.
    I want to scroll one row of datagrid with per mousewheel
    scroll. I am not getting how to use the scrollMouseWheelMultiplier
    property of the IConfiguration class because i am not able to
    create the object of this class.
    I am using the Flex 3.0 and flash 9 version.
    please help me out around this.

  • Is there a way to use Illustrator to draw over a live video feed coming from my microscope?

    Hi, we use illustrator to draw (trace) over static images of mite specimens taken under a microscope. Although this works, it would be much better to be able to draw directly from the live video feed coming from my microscope. The specimens are dead, so they are not moving around, however, we need to focus down through the specimen in order to see all details. We normally take montage images, but because the specimens are clear there are many artifacts present and we frequently have to consult the specimen under the microscope to double check things. My students and I have hundreds of drawings to complete and are looking for a way to streamline the process. If we could avoid making montage images and draw direct from the video feed, it would revolutionize the way we approach our research. Is there a way to display the video feed and then overlay Illustrator so that we can directly trace over the image (we use a Wacom tablet, but that shouldn't make a difference) so we can focus at different levels and draw the entire organism?
    Thanks for your help
    Ashley 

    Maybe it's possible to have live video in Illustrator, but you would most certainly need to write your own plugin.
    So this community would be suitable:
    http://forums.adobe.com/community/illustrator/illustrator_sdk?view=discussions

  • HI .. I have a new macmini 2.5 Ghz 10.7.3 Lion, had a problem today ,it froze so I could not shut down using mouse or tablet. used the power switch, when I tried to restart I got audible 'beeps' from it.

    HI ....I have a new macmini 2.5 Ghz 10.7.3 Lion, had a problem today ,it froze so I could not shut down using mouse or tablet pen. used the power switch, when I tried to restart I got audible 'beeps' from it. I managed to restart it but kept getting a message come up on one ot the dual screens ' restart using the power swich to turn it off , then press it again to restart.'
    This worked okay , but now it just keeps freezing whenever I start it up. I thought the issue could be my old Epson Expression 1680 scanner not being compatible , so I have unplugged it. I also had a look at the new memory I installed when I got it, but this seems not be the problem.
    It is connected up to an Eizo Flexscan S2231W using a cable straight into the HDMI input , the other monitor is a small Acer using the VGA into Thunderbolt port.
    When I turn the Eizo screen on first and then press the power button on the mac-mini, I hear the chime then the screen flahes the 'Digital no signal' message on and off for about 30 seconds , then the monitor comes on as normal. But it is still freezing up on me after using it for a while and I am having to use the power switch button to turn it off again.
    Can anyone help please.

    I really don't have an answer for that one. I guess that while trying to get things working correctly, I would use the most basic monitor I had which in your case would be the Eizon using the Thunderbolt port and adaptor.
    When you boot into Safe Mode the startup is quite slow, but you should get the Apple logo and then the spinning gear below it (release the SHIFT key when it appears.) Then after a little more time you should see a gray progress bar appear below the spinning gear. When that disappears the computer will startup to a login screen.

  • After las update some menus doesn't work properly. Ther is non possibility to use mouse. Why?

    After las update (9.2.1) some menus doesn't work properly. Ther is non possibility to use mouse. Why?

    Operating System?

  • [Fixed?] Cannot use mouse and touchpad at the same time after upgrade

    Dell Inspiron 6400 laptop, Synaptics touchpad, external wireless USB mouse (Logitech).
    Yesterday I did a full system upgrade which among other packages upgraded
    [2007-11-08 00:06] upgraded synaptics (0.14.6-2 -> 0.14.6.99-1)
    [2007-11-08 00:06] upgraded tzdata (2007h-1 -> 2007i-1)
    [2007-11-08 00:06] upgraded xf86-input-keyboard (1.1.1-1 -> 1.2.2-2)
    [2007-11-08 00:06] upgraded xf86-input-mouse (1.2.1-1 -> 1.2.3-1)
    [2007-11-08 00:06] upgraded xf86-video-i810 (1.7.4-2 -> 1.7.4-6)
    [2007-11-08 00:06] upgraded xf86-video-vesa (1.3.0-1 -> 1.3.0-5)
    [2007-11-08 00:06] upgraded xorg-server (1.2.0-5 -> 1.4-4)
    Before the upgrade, I was able to use both the touchpad and the mouse at the same time, using the following xorg.conf settings:
    Section "ServerLayout"
    InputDevice "Touchpad" "CorePointer"
    InputDevice "USB Mouse" "AlwaysCore"
    Section "InputDevice"
    Identifier "USB Mouse"
    Driver "mouse"
    Option "Device" "/dev/input/mice"
    Option "SendCoreEvents" "true"
    Option "Protocol" "IMPS/2"
    EndSection
    Section "InputDevice"
    Identifier "Touchpad"
    Driver "synaptics"
    Option "Device" "/dev/psaux"
    Option "Protocol" "auto-dev"
    EndSection
    After the upgrade, the touchpad was still working with these settings but the mouse wasn't.  I then changed the xorg.conf settings as follows:
    Section "ServerLayout"
    InputDevice "USB Mouse" "CorePointer"
    InputDevice "Touchpad" "AlwaysCore"
    with the InputDevice sections remaining the same for USB Mouse and Touchpad.  After this change the mouse was working but the touchpad wasn't.  Finally, I changed the xorg.conf settings as follows:
    Section "ServerLayout"
    InputDevice "Touchpad" "CorePointer"
    InputDevice "USBMouse" "SendCoreEvents"
    with the InputDevice sections remaining the same for USB Mouse and Touchpad.  This didn't change anything from the last setting: the mouse was working but the touchpad wasn't.
    How can I restore the ability to simultaneously use mouse and touchpad?
    Last edited by RobF (2007-11-09 20:20:54)

    Try this:
    Move "SendCoreEvents" to the Touchpad line (replacing the "AlwaysCore" bit) and then comment out the USB mouse.  So in the end, it'll look like this:
    Section "ServerLayout"
    InputDevice "Touchpad" "SendCoreEvents"
    # InputDevice "USBMouse"
    EndSection
    Restart X and see if everything is working right.
    PS: You may also want to consider changing the Touchpad device line to "/dev/input/mouse2" instead of "/dev/psaux" as I believe psaux has been deprecated in kernel 2.6.  I could be wrong, but I can tell you that /dev/input/mouse2 works great with the touchpad on my Dell e1505.

  • Is it possible to delete a plot with using mouse to select it on the graph control?

    For example, when I use PlotLine to plot thousands of lines on the graph control, I want to delete some of them, but there is thousands of plotHandle generated.
    How can I get the plotHandle of the specific line on the graph control with using mouse to select it?
    If I record information of the lines, ex. the plotHandle and the coordinates, on a table or list, etc. , I have to compare the information of lines to get the plotHandle of the specific line.
    Is there any user-friendly way to delete a plot by select it on the graph control?
    Solved!
    Go to Solution.

    Sure! Look at the example located in \samples\userint\graphcursors for an example of how to accomplish this task.
    Briefly:
    The cursor must be in "Snap to point" mode
    (To be confirmed) The graph must be in "Retain" data mode
    You must have a callback for the graph control
    You can use GetGraphCursorIndex to retrieve the plot handle
    GetGrpahCursor retrieves values of cursor position in engineering units
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Function modules supported by seal system used to print drawing documents

    Hi,
    As per my current requirement, while create purchase order (ME21N), the drawing document (which are linked with materials of the PO) should print along with the PO form (smartform). The drawing are stored in the Auto CAD system. Seal software has already installed to print drawing documents.
    But I would like to know the function modules supported by seal system used to print drawing documents.
    Thank you.
    Tulasi

    Tulasi,
    May be you can approach it this way
    create a ztable with fields matnr and graphic object(check STXBITMAPS table for the attributes of this field) and upload the drawings against every material.Now you will have a table containing the matnr and the corresponding drawing in the table which can be used for further  processing.
    Hope  any of the SDN experts here will suggest a better solution.
    Kiran.

  • Using basicStroke to draw the INSIDE of a polygon

    hello
    i have a polygon that i want to trace the inside of... using:
    g2.setStroke( new BasicStroke( 20, //float width,
    BasicStroke.CAP_SQUARE, //int cap,
    BasicStroke.JOIN_MITER,
    1,
    new float[] { 12, 12 },
    1
    g2.draw( myRect );
    this code traces the shape "on the line", and since the stroke width is 20 pixels, it is painting both inside and outside of the shape itself.
    i would like to trace the inside of the shape. or for that matter, the outside of the shape...
    any ideas?
    thanks
    ERIK!

    First draw the shape using g.fill() and a
    non-transparent color. Then set an alpha composite
    with the rule SRC_IN, and redraw the shape using the
    desired stroke. Only the part of the stroke inside
    the filled area will be drawn. Use SRC_OUT to draw
    outside the shape. If you're drawing on top of
    existing graphics, you may have to use a BufferedImage
    as a temporary work area to composite the shape and
    then draw the image to your graphics context.thanks for the suggestion, although i believe that this will not render the outer edge of the stroke as intended...
    what i mean is, where you use the shape itself to mask the stroke, it will leave a not-as-pretty edge as you would get if from an un-masked basic stroke.
    thanks for the two suggestions though.

  • Using mouse overs with pop-ups

    I'd like to create a pdf using mouse overs to display otherwise hidden text (in describing various portions of a photo in the doc).  Can anyone lead me in the right direction as specific guidance in 'Help' has so far been limited?

    You can use the "Tooltip" for an easy method. You can also use teh "On Focus" and "On Blur" action of a field to show or hide a hidden field by either the drop down actions or JavaScript.

  • Scroll list down by page wise using mouse

    hi experts,
      how   can we scroll a list page wise  rather than line wise using scroll button of  mouse .
      my requirement is to generate a list consisting of 38 lines per page and each set of 38 lines
      should come in a new page that i have done using new-page, but problem is when i scroll
      down a list using mouse scroll button next page should be displayed rather than scrolling
      line by line . just like using pagedown key of the keyboard,
    thanks in advance.

    I think this is not possible, I don't think controlling the mouse operation is possible

  • How to make image resizable using mouse ?

    Hi,
    I want to know about that how to resize image by using mouse in Java Canvas. I created some tools like line, free hand, eraser. And want to know how to make an image resizable in canvas by using mouse. An image is jpeg, png, or gif format. I want to make image stretch and shrink by using mouse.
    Please help me..
    Thnax in advance.
    Manveer

    You make a listener to handle the mouse event that you want to capture, then program the affect you want using the event as the trigger.

Maybe you are looking for

  • Envio e recebimento de mensagens

    Olá, formatei meu notebook e quero recuperar os e-mails que eu tenho guardados no meu notebook e que eu visualizava (recebidos, enviados, rascunhos e lixeira) pelo Thunderbird e peço instruções de como recuperar e trazer de volta tais e-mails. Aprove

  • Welcome to the Legacy Conference

    Welcome to the Legacy series discussion board! Got a question about your older model Thinkpad?  Ask the members here for assistance.  Lets not let those wonderful older machines go to waste! Whether you're visiting from the forums at thinkpads.com, N

  • Nano won't resume tune when turned on again - jumps to next one.

    I was under the impression that, if I turned my nano off in the middle of a tune, it would resume playing that tune when switched on again and play is pressed. Mine waits for about 2 seconds and then jumps to the start of the next tune, every time. I

  • Gift cards don't work?

    I have entered the codes correctly so many times... but iTunes says that the code doesn't exist... Clearly it does lol. What should I do?

  • Missing Renderer Message

    I've been using the MPE Hack with my GTX 260 and now it longer works.  I get the Missing Renderer message when I fire up a project.  The one that says I will have to use the Software part of MPE and not the Hardware of MPE.  Anyway, I searched and re