Drawing smooth circles in labview

Hi 
I am using the 'Draw Circle by Radius' VI to draw a pie chart inside a picture box. Its all fine, except that the circle edges are not exactly smooth (see the attached pic). 
I tried looking for it on the net, but couldn't find anything of much use. 
Any ideas on how to make the edges nice and smooth? 
Solved!
Go to Solution.
Attachments:
Circle Jagged edges.png ‏26 KB

Hi
The circle is not smooth as no anti-aliasing is done with the picture drawing VIs. To get it to appear smooth you would need to implement an anti-aliasing algorithm in the picture control. This is not something I have ever seen done. You could download MSChart from Microsoft, it is just a free .NET component and code that you can download. Thoric has done a great example here https://decibel.ni.com/content/docs/DOC-9946 that you could start with to draw the pie chart for you.
Mike

Similar Messages

  • How to draw the circle diagram of induction motor using labview

    hi
      i am trying to model the  electrical machines using labview..
    i want to know that is it possible to draw the circle diagram of induction motor using labview..........
    if its possible then please suggest me the possible ways.
                                                                                         thanks

    There may be better ways, but the method I used was to convert amplitude & angle to rectangular coords, then create an XY plot from (0,0) to those coords.  (Or 1 plot for Voltage, 1 for Current, etc.)  I would then just keep updating this plot and feeding it to the graph in a loop.  The result was a slightly choppy looking but useable animation of the phase vectors.
    -Kevin P.

  • Smooth Circles

    I am having difficulty drawing a smooth circle with a border with another circle (somewhat smaller circle) layered on top with the same size border. I got a very smooth circle using the rounded rectangle tool and snap to pixels but don't know how to get a border using the rounded rectangle tool.  Any help is appreciated.

    Hi
    The circle is not smooth as no anti-aliasing is done with the picture drawing VIs. To get it to appear smooth you would need to implement an anti-aliasing algorithm in the picture control. This is not something I have ever seen done. You could download MSChart from Microsoft, it is just a free .NET component and code that you can download. Thoric has done a great example here https://decibel.ni.com/content/docs/DOC-9946 that you could start with to draw the pie chart for you.
    Mike

  • Where can I find the VI "draw a circle by radius" (it's used in NI demo) ?

    I work wiht LabVIEW 6.0.2 full version
    And I'd like to use some "picture functions". But I didn't find those functions... So I went to NI site to find some help but it seems that some commands and functions are missing on my computer because I can't find the library "picture.llb" and the VI "draw a circle by radius" whereas with NI example it is written that no add-on is required...

    Take attached zip file
    Attachments:
    picture.zip ‏204 KB

  • How do I draw a circle in MUSE?

    How do I draw a circle in MUSE? Holding shift&rectangle tool (as in InDesign) isn't working.

    obcomm - Use the Rectangle tool to draw a square. Click the corner options in the Control toolbar, then increase the size until you have a circle.
    David

  • Draw animated circle with brush tool in Flash

    Hello all,
    I need to make a circle with a brush tool so that it looks like a child draws it. If I make a dot with the brush tool on the first frame and a circle on the 15th frame and then create shape tween between those frames it looks stupid, like the circle grows itself.
    Is there any possibility of making such a thing except for drawing it per frame?
    Thanks
    Julia  

    I'm just asking what is the method to draw a circle with a brush that you can see it animated - I mean the process of drawing. For now the only thing I know is to draw every small piece of it frame by frame but I suppose there is a better method.

  • Draw graphics, circles

    Hi Guys,
    I ahve a question in ABAP using graphics.
    can we draw a circle, rectangle(a box) , arrows in ABAP.
    My requierment is, we have certain products which we need to link with arrows and there are group of products which I need to put into circle or rectangle.
    plz suggest..
    regards,
    Nazeer

    Hi Nazeer,
    use given below code & try to understand. Test run on your server.
    DATA: BEGIN OF TAB OCCURS 5,
          CLASS(10) TYPE C,
          VAL1(2) TYPE I,
          VAL2(2) TYPE I,
          VAL3(2) TYPE I,
          VAL4(2) TYPE I,
          VAL5(2) TYPE I,
          VAL6(2) TYPE I,
          END OF TAB.
    DATA: BEGIN OF OPTTAB OCCURS 1,
            C(20),
          END OF OPTTAB.
    MOVE: 'anik' TO TAB-CLASS,
          6 TO TAB-VAL1, 7 TO TAB-VAL2, 8 TO TAB-VAL3, 3 TO TAB-VAL4,  5 TO TAB-VAL5, 6 TO TAB-VAL6.
    APPEND TAB.
    CLEAR TAB.
    MOVE: 'narendra' TO TAB-CLASS,
          15 TO TAB-VAL1, 10 TO TAB-VAL2, 18 TO TAB-VAL3, 3 TO TAB-VAL4,  5 TO TAB-VAL5, 6 TO TAB-VAL6 .
    APPEND TAB.
    CLEAR TAB.
    MOVE: 'gaurav' TO TAB-CLASS,
          17 TO TAB-VAL1, 11 TO TAB-VAL2, 20 TO TAB-VAL3, 3 TO TAB-VAL4,  5 TO TAB-VAL5, 6 TO TAB-VAL6.
    APPEND TAB.
    CLEAR TAB.
    MOVE: 'Kushagra' TO TAB-CLASS,
          10 TO TAB-VAL1, 12 TO TAB-VAL2, 15 TO TAB-VAL3, 3 TO TAB-VAL4,  5 TO TAB-VAL5, 6 TO TAB-VAL6.
    APPEND TAB.
    OPTTAB = 'FIFRST = 3D'.     APPEND OPTTAB.
    OPTTAB = 'P2TYPE = TO'.     APPEND OPTTAB.
    OPTTAB = 'P3TYPE = PY'.     APPEND OPTTAB.
    OPTTAB = 'P3CTYP = RO'.     APPEND OPTTAB.
    OPTTAB = 'TISIZE = 5'.      APPEND OPTTAB.
    OPTTAB = 'CLBACK = X'.      APPEND OPTTAB.
    *CALL FUNCTION 'GRAPH_MATRIX_3D'
        EXPORTING*
             COL1        = 'monday'*
             COL2        = 'tuesday'*
             COL3        = 'wednesday'*
             DIM2        = 'employees'*
             DIM1        = 'months'*
             TITL        = 'Comparison of Employee attendace in different months.'*
        TABLES*
             DATA        = TAB*
             OPTS        = OPTTAB*
        EXCEPTIONS*
             OTHERS      = 1.*
    CALL FUNCTION 'GRAPH_MATRIX_3D'
      EXPORTING
        COL1 = 'monday'
        COL2 = 'tuesday'
        COL3 = 'wednesday'
        COL4 = 'thursday'
        COL5 = 'friday'
        COL6 = 'saturday'
        DIM1 = 'week days'
        DIM2 = 'employees'
      TABLES
        DATA = TAB
        OPTS = OPTTAB.
    LEAVE PROGRAM.
    I hope it will help u a lot.
    Regards,
    Narendra

  • Req: Draw Concentric Circles - help please!

    Hi all!
    Newbie question:
    I'm trying to draw a series of concentric circles in Flash 5
    The circle tool always starts to draw the circle from a
    corner - this makes it tricky to draw a set of concentric circles
    I'm sure there's a way of setting defaults so that Flash will
    draw circles (or other shapes like rectangles) about their centres
    instead of their corners, but I can't find the setting.
    Sorry for the dumb question!
    Thanks in anticipation
    Dave

    Thanks, but it's still not quite what I'm after.
    If you scale the circles serially as you suggest, the gap
    between circles is not equal; as the circles get smaller, the gap
    between them also gets narrower, rather like ripples on a pond. I
    wanted the circles to be concentric, but each one to be a fixed
    distance from the next, rather than a geometric progression.
    Also, I'd still like to be able to constrain the "draw
    rectangle" and "draw circle" commands to draw from the centre
    rather than the corner....
    Any more suggestions, or is upgrading to Flash 8 the only
    solution ? ;-)
    Thanks
    Dave

  • How Do I Draw a Circle / Line Through An Image In Pages?

    Hi guys,
    I never do anything very involved in Pages but today ...
    I have an image (jpeg file) and I would like to draw a circle around it and a line through it -- you know, turn it into one of those International "Don't Do This" signs.
    Is there an easy way?
    Thanks
    I'm using Pages '09 version 4.1

    Insert a round Shape and give it a very thick border with equally thick line (also in Shapes) diagonally across the circle.
    To add the image just drag it onto the shape and when you positioned it the way you like it, group the two.
    Peter

  • Where can I find the Ellipse Tool in PE 12 in order to draw a circle ?

    Where can I find the Ellipse Tool in PE 12 in order to draw a circle ?

    ReaderTortune
    Besides the article to which GautamBahl referred....
    You may also want to review the following for working with the Titler's Shapes in Premiere Elements 12.
    http://www.atr935.blogspot.com/2013/08/pe11-titler-shapes-for-highlighting.html
    Thanks.
    ATR

  • Draw a circle on a jFrame

    Hi! How can i draw a circle over a jFrame?

    In general trying to draw directly on a JFrame is not a good idea and can be problematic. You should think about doing your drawing in a JPanel and adding that to the frame
    Here are a number of things to look at in drawing a circle
    Graphics.drawOval(...)
    Ellipse2D, Ellipse2D.Double
    Area - you can create an area from any Shape, and it offers a lot of advantages to dealing with Shape
    Graphics2D.draw/fill(Shape)

  • Drawing a circle

    Hi Friends,
    I have the following requirement. I am relatively new to Java
    1. Draw a circle
    2. Draw a rectange at the center of the circle
    3. Draw lines from the top edge of the circle to various points in the circle.
    4. Convert this graphic into a gif or a png image.
    Can this be achieved using Java 2D. If yes, can you pls provide me some sample code if possible.
    Thanks a lot for your help.

    You can also use the TextLayout class for displaying text.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.net.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class GraphicsTest
        public static void main(String[] args)
            GraphicsPanel panel = new GraphicsPanel();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(panel.getUIPanel(), "North");
            f.getContentPane().add(panel);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class GraphicsPanel extends JPanel
        Font font;
        String text;
        public GraphicsPanel()
            font = new Font("lucida bright regular", Font.PLAIN, 22);
            text = "centered text";
            setBackground(Color.white);
        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 cx = w/2;
            int cy = h/2;
            int dia = Math.min(w,h)*7/8;
            g2.setPaint(Color.blue);
            g2.draw(new Ellipse2D.Double(cx - dia/2, cy - dia/2, dia, dia));
            g2.setPaint(Color.orange);
            g2.draw(new Rectangle2D.Double(cx - dia/4, cy - dia/4, dia/2, dia/2));
            g2.setPaint(Color.blue);
            double theta = -Math.PI/2;
            double
                x1 = cx,
                y1 = cy + (dia/2) * Math.sin(theta),
                x2,
                y2 = cy + (dia/4) * Math.sin(theta);
            g2.draw(new Line2D.Double(x1, y1, x1, y2));
            theta = -Math.PI*3/4;
            x1 = cx + (dia/2) * Math.cos(theta);
            y1 = cy + (dia/2) * Math.sin(theta);
            x2 = cx + (dia/4) * Math.sqrt(2) * Math.cos(-Math.PI*5/4);
            y2 = cy + (dia/4) * Math.sqrt(2) * Math.sin(-Math.PI*5/4);
            g2.draw(new Line2D.Double(x1, y1, x2, y2));
            theta = -Math.PI/4;
            x1 = cx + (dia/2) * Math.cos(theta);
            y1 = cy + (dia/2) * Math.sin(theta);
            x2 = cx + (dia/4) * Math.sqrt(2) * Math.cos(Math.PI/4);
            y2 = cy + (dia/4) * Math.sqrt(2) * Math.sin(Math.PI/4);
            g2.draw(new Line2D.Double(x1, y1, x2, y2));
            g2.setFont(font);
            FontRenderContext frc = g2.getFontRenderContext();
            float textWidth = (float)font.getStringBounds(text, frc).getWidth();
            LineMetrics lm = font.getLineMetrics(text, frc);
            float x = (w - textWidth)/2;
            float y = (h + lm.getHeight())/2 - lm.getDescent();
            g2.drawString(text, x, y);
        public JPanel getUIPanel()
            JButton save = new JButton("save");
            save.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    saveImage();
            JPanel panel = new JPanel();
            panel.add(save);
            return panel;
        private void saveImage()
            int w = getWidth();
            int h = getHeight();
            BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
            Graphics2D g2 = bi.createGraphics();
            paint(g2);
            g2.dispose();
            try
                ImageIO.write(bi, "png", new File("test.png"));
            catch(IOException ioe)
                System.out.println("IOE: " + ioe.getMessage());
    }

  • How to Generate Excel XY Scatter Smooth Chart in LabVIEW?

    Hi all
    First of all i am a beginner. We can plot the XY Scatter Smooth graph in excel using Report Generation toolkit but how can we generate that in labVIEW? In my application maximum we use only 5 points to plot a graph. From the graph we want to find the X value for a fixed Y value. Manually how i do is i will create an XY Scatter smooth graph in excel and will find the Y value. If we plot this 5 point in LabVIEW it will not be smooth curve and i tried many curve fitting subVI's for making it smooth. But we cannot generate the plot exactly that of excel. Is there any way to read the chart from excel?
    Please help me.
    Thanks & Regards
    Rajesh R. Nair

    Rajesh, I believe I may have what you are looking for. I have some images of the code I have made that generates a XY scatter smooth graph in excel based on a two dimensional array of X and Y points.
    The Code:
    The Result in Excel:
    Please let me know if this is what you are looking for,
                                                      ​                               Shadowfeld
    Attachments:
    Code.vi ‏18 KB

  • How to draw smooth curve in Hyperdraw??

    Okay, I've checked the manual 4x and have been playing with Hyperdraw for 30 minutes and still can't figure out how to draw a smooth bell curve in the Hypereditor... In Cubase, I would take the pencil tool and draw a nice curve but can't seem to figure out how do the same in Logic!
    Could someone pleeeeease lend me a clue...?
    Thanks.

    RealDave wrote:
    "The name on the package may say "Apple," but this is definitely not your typical mac application!"
    Yes, Logic was an acquisition. It has remained to this day "The Redheaded Stepchild". If they ever take
    some engineers off the iOS projects and put them on Logic, the application may shape up. Don't get your hopes too high though. iOS is where they make all the Money. Logic is small potatoes in Apples big picture.
    PS: This message will soon disappear because it contains truth.
    To give them credit, Logic made a HUGE jump in usability when it hit Logic 8.
    I mean, MASSIVE.
    It's actually usable by mortals now.
    Even among professional tools, there are well-designed ones and completely arcane ones with the same functionality.
    Logic grew over decades of adding an extra little limb here, and growing a third chin down there, etc., at the behest of a hundred studio techs missing this or that and calling up the engineers or higher-uppers. It was an extremely powerful, but utterly convoluted MESS.
    The fact that you can now explain the basic structure of Logic 8 in less than three minutes (the fact that it HAS a "basic structure", rather than just a kraken-like reenactment of 80 years of studio development known as "The Environment") makes a huge difference, and, though they've confused people who've whittled the beast into shape over the past twenty years by trying to make the application "Logical" (including key commands), the benefits to users are, IMHO, tremendous.
    I know a number of people who wouldn't have considered working with Logic before (Nuendo users), and now that Logic 9 appears to have fixed many of the most glaring bugs in Logic 8, are adding it to their toolset.

  • Drawing Rectangle shape using Labview 8.0

    Is it possible to draw a rectagle shape using Labview 8.0? I found in the HELP content tat it did exist some function related, but when i click on "place to block diagram" it doesnt work. So i susect tat it is for further version of Labview.
    I have an idea of how to draw the rectagle, which is by drawing line from point to point. Since i need to draw multiple of rectangle, so i hope tat there is an easier way to do it.
    Thanks for ur time and help.

    You can have the numbers created, programmatically
    Attachments:
    Example_VI_BD2.png ‏3 KB

Maybe you are looking for