I want to draw a line between 2 specific points on an image inserted in a Panel? Help, please!

I am a beginner in working with LabWindows/CVI and I want to draw a line between 2 specific points on an image inserted in a Panel? Please help or examples of code.

As evidenced by the Wolfgang there is a problem in the definition of recall. InstallCtrlCallback wants a reminder of the standard of review as a parameter: apparently you have structured your reminder callbackName on the prototype of a recall of Panel, which obviously missing the setting "control".

In addition, the recall of control should be said somewhere before it can be used. In other words, you must add his statement before your function {main}, either in one of your include files, or directly in the code. This is the reason for the error 'found int, whereas CtrlCallbackPtr. '

Third point: you create a new picture control in the callback assigned to the image control. And you reuse variable 'Test', which already holds a valid control ID...

Finally: what you expect to make from '1' in callbackData parameter, given that you do not use anyway? Unless you want to adapt the behavior of recall some past in callbackData conditions, you must pass NULL as the parameter.

Tags: NI Software

Similar Questions

  • draw the line between black pixel: coordinates of the selected pixels?

    Hello

    I want to build a script that can check a Photoshop file and:

    -find the black pixel

    -for each black pixel, looking for an another black pixel at a maximum distance of 5 pixels

    -then draw a line between the two black pixels.

    I wrote this script below (my first script...), but it's VERY slow (and my final image is VERY large), I think because I test the color for each pixel in the image.

    So an alternative would be to select a black pixel with the wand, then the script record all the details of the selected pixels, then my script wil test only the pixels (less than 1% of the pixels are black in my image).

    Is this possible with JavaScript?

    Thank you for your answer!

    Marc

    function main(){
     var startRulerUnits = app.preferences.rulerUnits;
     app.preferences.rulerUnits = Units.PIXELS;
    
    
     var myHeight = app.activeDocument.height;
     var myWidth = app.activeDocument.width;
    
    
    // Find black pixel
     for(var i=5; i<myWidth; i++) {
      for(var j=5; j<myHeight; j++) {
       activeDocument.colorSamplers.removeAll()
       var sampler = activeDocument.colorSamplers.add([new UnitValue (i, 'px'), new UnitValue (j, 'px')]);
       if (sampler.color.rgb.hexValue === "000000") {
    
    
    // For each black pixel, search another black pixel below left up to 5 pixels
        for (var m=i-5; m<i; m++) {
         for (var n=j+1; n<j+5; n++) {
          activeDocument.colorSamplers.removeAll()
          var test = activeDocument.colorSamplers.add([new UnitValue (m, 'px'), new UnitValue (n, 'px')]);
          if (test.color.rgb.hexValue === "000000") {
    
    
    // Then draw a black line between the two black pixels
           var FillColour = new SolidColor;
           FillColour.rgb.hexValue = '000000';
           var ad=activeDocument;
           ad.selection.select([[m,n],[i,j],[m,n+1],[i,j+1]], SelectionType.REPLACE, 0, true);
           ad.selection.fill(FillColour);
           ad.selection.deselect()
          }
         }
    
    
    // For each black pixel, search another black pixel below right up to 5 pixels
         for (var m=i+1; m<i+5; m++) {
          for (var n=j; n<j+5; n++) {
           activeDocument.colorSamplers.removeAll()
           var test = activeDocument.colorSamplers.add([new UnitValue (m, 'px'), new UnitValue (n, 'px')]);
           if (test.color.rgb.hexValue === "000000") {
    
    
    // Then draw a black line between the two black pixels
            var FillColour = new SolidColor;
            FillColour.rgb.hexValue = '000000';
            var ad=activeDocument;
            ad.selection.select([[i,j],[m,n],[m,n+1],[i,j+1]], SelectionType.REPLACE, 0, true);
            ad.selection.fill(FillColour);
            ad.selection.deselect()
           }
          }
         }
        }
       }
      }
     }
    }
    main();
    
    

    If someone wants to do the same thing, the ImageJ software works very well on very large images (1 billion pixels) by the process according to > binary > close

  • Hello. I want to change my country of the Jamaica, to the United States but the United States offers none as payment option. I just want to try the new Pokémon go app that is not available in Jamaica. Help, please

    Hello. I want to change my country of the Jamaica, to the United States but the United States offers none as payment option. I just want to try the new Pokémon go app that is not available in Jamaica. Help, please

    Unless you are in the USA, expect it to be available in Jamaica. People can not download content from iTunes Store from another country; This is why it is not an option for you.

    (143448)

  • I pay a monthly subscription and when I upgraded to inDesign CC 2015 he now asks if I want to start a trail. I can't work and I have a period. Help, please.

    I pay a monthly subscription and when I upgraded to inDesign CC 2015 he now asks if I want to start a trail. I can't work and I have a period. Help, please.

    Hi André,.

    Please check the help below document:

    https://helpx.Adobe.com/manage-account-membership/CC-reverts-to-trial.html

    Kind regards

    Sheena

  • Draw a line between two entities

    Hello. I am on the Data Modeler and I use the Visual tool. I want to connect 2 entities with just a line that I can add comments or notes. I can create a relationship of foreign key between 2 entities now, but a primary key is required to do this. Some of my tables do not have primary keys, but I need to put a line between them, with comments or notes saying what relations there are. I know that the software is by default to foreign key relationships via primary keys, but I need to draw my own in there. Any ideas? Thank you!

    Yes, this is a frequent question on the forum. Once you draw the line, he opens a straight dialogue/property box? On the left, you will see a node called related columns. Click on that. You will see the map with the column name that is generated in the child column field. Click on that column and you'll see that it really is a drop-down selection list, which will show you all the FK "candidate" columns already in the table. One of them will be hopefully the FK column that you want to attach. Pick it up. When you click on apply or OK, the tool will ask you if you want to remove the generated column. Select "Yes".

    Note: the drop-down list won't give you the possibility to select the columns having the same exact data type and column PK of the source size. If the column that you want to attach to the is not an exact match, the tool will not let you join her. I had a situation where my PK was a surrogate Number key (9), but the target FK column was Number (6). I had to change the definition of column target in order to define the FK in the model. (So I added a note on the column of this change and why I did it). Unfortunately the model is now synchronized with the Pb of the production. Finally, we must convince the DBA to make the change (unless it's a third-party to which application cases you will have to live with it).

  • How to draw a line between two buttons?

    Hello.

    I want to do two mobile buttons attached to a line. When changing the position of any button you change in the appearance of the line of course.  I know how to draw a line, but after MOUSE_DOWN and I don't know how to remove an old monotube and how this line to appear all the time?

    My code

    btn2.addEventListener (MouseEvent.MOUSE_DOWN,
    mouseDownHandler3);
    btn2.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler3);
    btn3.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler3);
    btn3.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler3);

    Set a mouse down Manager (the user is dragging)
    function mouseDownHandler3(evt:MouseEvent):void {}
    var object = evt.target;
    We have to limit them by dragging to the area inside the canvas
    object.startDrag ();
    }
    function mouseUpHandler3(evt:MouseEvent):void {}
    var obj = evt.target;
    obj.stopDrag ();
    spisujemy x, y
    var x2Pos:Number = btn2.x;
    var y2Pos:Number = btn2.y;
    var x3Pos:Number = btn3.x;
    var y3Pos:Number = btn3.y;
    trace (x3Pos);
    trace (y3Pos);
    var roundObject:Shape = new Shape();
    roundObject.graphics.lineStyle (2, 0 x 990000,. 75);
    roundObject.graphics.moveTo (x2Pos, y2Pos);
    roundObject.graphics.lineTo (x3Pos, y3Pos);
    this.addChild (roundObject);
    this.removeChild (this.getChildAt (this.numChildren-1));
    }

    Source. FLA: http://www.mediafire.com/?y2tyzz4zxun

    Here is a solution that you can adapt for two or more buttons...

    var btns:Array = [btn2, btn3]; instances in concert

    handlers all btn
    function setBtns (): void {}
    for (var i = 0; i)
    inclinometer [i] .buttonMode = true;
    inclinometer [i] .addEventListener (MouseEvent.MOUSE_DOWN, grab);
    inclinometer [i] .addEventListener (MouseEvent.MOUSE_UP, drop);
    }
    }

    setBtns();

    inspired by ECCAS btns lines all while occurs wildfire
    function drawLines(e:Event=null):void {}
    Graphics.Clear;
    graphics.lineStyle (2, 0xFF0000);
    ((graphics.moveTo(btns[0].x+(btns[0].width/2), btns[0].y+(btns[0].height/2));

    for (var j = btns.length - 1; j > = 1; j-) {}
    ((graphics.lineTo(btns[j].x+(btns[j].width/2), btns[j].y+(btns[j].height/2));
    }
    }

    managers
    function grab(event:MouseEvent):void {}
    event.target.startDrag ();
    addEventListener (Event.ENTER_FRAME, drawLines);

    }

    function drop(event:MouseEvent):void {}
    event.target.stopDrag ();
    removeEventListener (Event.ENTER_FRAME, drawLines);

    }

    drawLines();

  • Straight line between two polar points

    Hi all

    I created a VI that could be traced a Polar curve according to time-distance formula. The VI has present Mag and target Mag. each with its own angle (Polar form that is (r, theta)). I want to draw a straight line from the current point to the target point. I used the time-distance formula to trace the scale and used the same slope to point the angle. However, I get a curved path as shown in the attachment.

    Could someone tell me what formula can be used to draw a straight line from the current point to the target point?

    Thank you.

    1 convert two polar points in rectangular coordinates.

    2. generate the points between the two.  You can use the function of ramp or some other methods to generate points.

    3 convert points to polar coordinates and draw.  Nice straight line!

    Of course, the question is why do you want a straight line when you use the polar coordinates?  He will not directly be r or theta.

    Bruce

  • I need to number the lines of my page document for the presentation of the journal. Help, please!

    I need to number the lines of a document to be submitted to a journal. I can make a section in the document, but I can't find a command, and then add the line numbers.

    Hi Misha,.

    3 pages includes number of words to display as a menu item in the view menu:

    The County appears at the bottom left of the page and it shows more options when you click on it. Unfortunately, "number of lines" is not included in the available options:

    If you had ' 09 Pages on your Mac and did not intentionally removed it when you installed 5 Pages, it will always be there, in a folder named iWork ' 09, in your Applications folder.

    Copy your document, open the Pages ' 09 and paste the contents of your document into a word processor new document in Pages ' 09.

    Check that the end of the document is delivered on the same page (number) and to the same position on this page as in the original and making small changes at the margin to adjust it if necessary.

    Then go to edit > tools > statistics to see this more comprehensive report:

    Note that if you need to present the newspaper article in one format other than a file of Pages, the number of rows may change due to changes in the conversion to the new format of formatting.

    If you don't have a Pages ' 09, you can get a number of lines using tools > line numbers in OpenOffice or LibreOfficeApache. Both are applications open source, free to download and use (even if you might donate help the future evolution of the demand). The links will take you to their respective Web sites.

    Oh... One more thing (as long as Steve jobs used to say sometimes): pages (3), go (menu) Pages > provide pages of comments and make a feature request so that the line count (and line numbering) added the capability of 3 Pages.

    Kind regards

    Barry

  • DeskJet 3070 on line and connected by PC tells me unable to print, not connected - help please

    I'm on a laptop with Windows 7. I recently moved the printer to a different location. I tried to print them, but in vain. I re-installed the CD and re-configured the wireless, restarted the printer and PC, but no matter what, when I try to print, my PC comes up with the printer is error offline and will not print.

    Can anyone help please?

    Go to control panel > printers and delete all instances of old of the printer.

    1. make sure the printer is on and connected to your network. Verify that you can access the printer's internal web page by accessing its IP address before continuing. Get his IP address for a network Test printed on the front of the printer.
    2. click on > start > Control Panel > printers.
    3. click on add a printer
    4. Select local printer
    5. Select create a new port and select Standard TCP/IP Port, and click Next.
    6. under device type, select TCP/IP Device. Under the name of host or IP address, enter the IP address of the printer. Click Next.
    7. Select Hewlett-Packard in the list of manufacturers and select and select your printer model. Click Next.
    If your printer model is not in the list, then select disk provided, browse the CD that came with your HP printer and select the first file begins with hp and ending with INF. click Open, then OK. Select your printer model. Click Next.
    8. If prompted, use the driver that is currently installed.
    9. He will ask the name of the printer - enter a new name or use the one existing. This will be the name of the printer that you select from other applications.
    10. we may ask you to share the printer. Choose No.
    11. the printing area of Test Page is displayed. Go ahead and print it out.
    12. click on finish.

  • Draw a line connecting two points in the WPF chart

    I'm trying to understand the best way to draw a line between two existing points on my graph in WPF.  At first, I thought I had it works fine; I just added another parcel to my graph then given exactly two points for rendering.  But I quickly noticed that the app has become surprisingly slow and CPU was quite high (adding other plots does not affect the use of the CPU as long as they have a complete set of points (?)).  He wants me if I looked at using the DataToScreen method on the chart but I can't know what the parameters are.  The second parameter is simply an IList that tells me a lot.  This seems to be the method I want to use for the coordinates of a point on the graph screen.

    No one knows what the second parameter is supposed to be for the DataToScreen method?  Everything I tried throws an Exception of Argument.

    Thank you
    Dan

    DataToScreenwill return a screen coordinate in the plot area of a chart of the value of the raw data horizontal and vertical in the given list. The parameter value is a IList for compatibility with other methods of graphical query such as FindNearestValue , return IList values containing raw data.

    A concrete example, say you had a graphical configuration with a wide horizontal axis ranging from 0 to 100 and a vertical axis double precision ranging from 10 to 20:


            
                
                
            
        

    To get the screen coordinates of the value at the center of the two axes, you can call:

    graph.DataToScreen(plot, new object[] { 50, 15.0 })

    Note that the raw data values corresponding to the type of axes (horizontal AxisInt32 returns the integer 50 and vertical AxisDouble Gets the value 15.0 ).

    You also mentioned a performance issue where "adding other plots does not affect the CPU so that they have a complete set of points". I did a simple test app that adds an array of two points of a chart on each key (for example graph.Data.Add(new[] { new Point(x1, y1), new Point(x2, y2) }); ), but could not reproduce the problem you saw. Could you share the code, you use to draw the connection line?

  • Problem by drawing a line dynamically

    Hello. I want to draw a line between two points in a dynamic way, it's average, by clicking on a canvas the first time will give the origin of the line and clicking will give once again, the end of the line (segment/stroke). I'll appreciate any help with this issue. Thanks in advance.

    Hello

    pls find the solution of your problem with the code below and let me know if you have any problem.

    Main.MXML

    http://www.Adobe.com/2006/mxml '.

    "Layout ="vertical"verticalAlign ="middle"xmlns:local =" * ">

    DrawingCanvas

    http://www.Adobe.com/2006/mxml"backgroundColor ="0xFFffff ".

    Width = "400" height = "300".

    creationComplete = "onCreationComplete () '"

    "xmlns:local =" * ">

    private function onCreationComplete():void

    {

    this.addEventListener (MouseEvent.MOUSE_DOWN, onMouseDown);

    this.addEventListener (MouseEvent.MOUSE_MOVE, onMouseMove);

    this.addEventListener (MouseEvent.MOUSE_UP, onMouseUp);

    }

    private var isMouseDown: Boolean;

    private var counter: number = 0;

    private var myShape: Shape = new Shape();

    private var : Point of origin;

    private var : destination Point;

    private function onMouseDown(event: MouseEvent):void

    {

    isMouseDown = true;

    origin = new Point (event.localX, event.localY);

    }

    private function onMouseMove(event: MouseEvent):void

    {

    if (isMouseDown is true)

    {

    destination = new Point (event.localX, event.localY);

    var lineThickness:Number = 2;

    var lineColor:Number = 0 x 000000;

    var lineAlpha:Number = 1;

    myShape.graphics.clear ();

    myShape.graphics.lineStyle (lineThickness, lineColor, lineAlpha);

    myShape.graphics.moveTo (origin.x, origin.y);

    myShape.graphics.lineTo (destination.x, destination.y);

    }

    }

    private function onMouseUp(event: MouseEvent):void

    {

    this.rawChildren.addChild (myShape);

    isMouseDown = false;

    }

    ]]>

    with respect,

    Mayeul Singh Bartwal

  • Draw the line width problem

    Hello

    1. work on the version of BB storm (9500/9530 Simulator) is v4.7.0.75
    2 opportunity BB JDE 4.7
    3. the request is:

    I want to draw a line with my own thickness as in 'C' we have a setPenStyle method. is there a method that will do the operation similar to the blackberry.

    Thank you

    Sendhil Kumar V

    Try this forum,

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&thread.ID=19608&view=by_date...

    See if it helps,

    Try drawFilledPath(),

  • How to create sharp lines between two text boxes?

    I create a book that is written by several people, and so I want to create a "chapter... author.

    Like this:

    Chapter 1... Jon Doe

    chapter2 ................................. Simon Harper

    so that these points have always the same distance.

    Help, please!

    Well, if your 'chapter' and your 'jon doe' is in the separate text boxes, then there is no easy way to do it. (You could draw a bunch of lines dotted, which isn't difficult, but the only way to standardize manually drag the lines around).

    However, if "chapter" and "jon doe" is in the same text box, separated by a tab character, then it is quite easy. Have you used a ruler before tab? This gives a test:

    (1) type a brief sample in a text area, like the one in your post, but instead of separate columns with points, simply use a single tab

    (2) select all text

    3) go to the Type-> tabs

    (4) I hope it sounds familiar to you (probably from MS Word, or maybe using a typewriter) but otherwise,.

    (4A), click once on the sovereign to insert a tab stop

    4 (b) type a question in the area of 'leader', and

    4 c) press Tab or Enter to confirm

    FYI, it's what you want, a 'leader' or a 'leader of dot. Knowing that he has called a "Chief" will help you find it in InDesign help.

  • funny things happening when you draw a line

    We're talking Ai CS5.

    I have a work plan with a mixture between 2 wavy paths, the kind of thing that you hope that the customer will not ask new :-)

    A path is in line with a horizontal guide at the top on the artboard and down by another.

    I draw a line between the two guides and nowhere segment near the mixture and expect to get just a boring straight line. Instead I'm out a lengthened version of the plantings, starting at the top with the first path and passing all stages of mixing arriving downstairs with the second path.

    Sorry, I have to describe it that way, but when I tried again once it no longer works, so I can't show you the result. Can someone explain what's happened here?

    TIA

    Steven

    Looks like you were in the Mode of insulation of the Blend object - you could accidentally entered this mode without realizing it by double-clicking on the object of the mixture. Now when you draw a simple line, the mixture is getting redesigned because now he sees 3 trails blend instead of the 2 paths.

    I hope this helps.

  • How to draw a line in time

    I want to draw a line, so that it looks, it is the transition from one point to another. Basically as it is drawn from point A to point B. I am able to draw a line with ActionScript, but I need to put a little interval in there (maybe 1/2 - 1 second) so that it looks like the line is drawn.

    Does anyone have any suggestions.

    Thank you.

    Dave

    might as well use onEnterFrame, pretty easy if the line is straight, if you're going to angle or curve you will need to use a little math to determine the next point. But for a left right right example of ot, try:

Maybe you are looking for