Trying to make a file viewer

I am trying to make a program which allows the user to select a file and display it on the screen in LabVIEW 6.1. My problem is that the Picture control seems to hold the previous as well as the current pictures. I am new to using image applications in LabVIEW and cannot find a way to erase the image (if I send an empty image it just goes into the rotation).
Can anyone offer some suggestions?

I'm not sure if this is what you mean, but attached is a small example program demonstrating the effect of the "Erase First" Property.
If you run the vi with Erase true, toggling the top switch between runs results in either one or two circles being drawn. If you set Erase to false, the drawing will always show two circles, regardless of the position of the top switch, or more accurately, any new drawing is simply layered on top of what's already there.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
Attachments:
picture_example.vi ‏34 KB

Similar Messages

  • Trying to make a file alias, but I'm stuck!

    I've come up with 3 ways to do the same thing, and none of them work..
    I want a droplet where I can drop a file (this case, a photo) and then an alias is created in another specified folder on the desktop. I have a hundreds of photos to go thru and i want to have a shortcut to the ones that are approved, so I can go back later and photoshop them. I don't want to double up on the photos and I want to keep the structure they're in now, so I don't want to move them.
    Where am I going wrong with any one of these...??
    *Script 1*
    on open draggeditems
    tell application "Finder"
    set draggeditem to theFile
    make new alias of file in folder "Approved" of folder "Desktop" of folder "kit" of folder "Users" of startup disk to theFile
    end tell
    end open
    Returns: The variable theFile is not defined.
    *Script 2*
    on open draggeditems
    tell application "Finder"
    set draggeditems to input
    set alias of the input to make new alias file at folder "Approved" of folder "Desktop" of folder "kit" of folder "Users" of startup disk to input
    end tell
    end open
    Returns: The variable input is not defined.
    *Script 3*
    on open draggeditems
    tell application "Finder"
    set sourcefiles to thisFile(draggeditems)
    repeat with thisFile in sourcefiles
    tell application "Finder" to reveal item thisFile
    set thisFile to thisFile as alias
    set alias of file in folder "Approved" of folder "Desktop" of folder "kit" of folder "Users" of startup disk to thisFile
    end repeat
    end tell
    end open
    Returns: Can't continue thisFile.
    I realise there's a trend showing here, but I can't seem to break it..

    The errors are fairly straightforward when you realize what's going on.
    In scenario 1:
    on open draggeditems
    so 'draggeditems' is a list of the files that were passed to your script.
    Two lines later you say:
    set draggeditem to theFile
    So now you're trying to set 'draggeditem' to 'theFile', but nowhere in your script is theFile defined. Hence the error.
    I'm assuming you want to extract each file from the list of draggeditems, in which case you want something like:
    <pre class=command>repeat with theFile in draggeditems</pre>
    so now 'theFile' contains a reference to each file in turn. From there you can make an alias to it:
    <pre class=command>make new alias to file theFile at folder "Approved" of (path to Desktop)</pre>
    So, in all your script should look more like:
    on open draggedItems
     repeat with theFile in draggedItems
      tell application "Finder"
       make new alias to file theFile at folder "Approved" of (path to Desktop)
      end tell
     end repeat
    end open</pre>

  • Problem trying to transfer multiple file over a network or the internet

    Hello I'm trying to make a file transfer program to transfer file over the internet or a network. I've been able to successfully transfer one file but when I try to send multiple files I keep getting a EOFException after the client trys to send the files. The client says it sent both files and the connection was closed but the server said that it only received one file and throws a EOFException. I've included the code from the client and the server. Any help is much appreciated.
    The Client
    private class createSocket implements Runnable {
              String address;
              int port;
              public createSocket ( String address, int port ) {
                   this.address = address;
                   this.port = port;
              public void run() {
                   try {
                   postStatusMsg( "Opening Connection at " + address + ":" + port );
                   Socket socket = new Socket( address, port );
                   postStatusMsg( "Connected to " + address + ":" + port );
                   DataOutputStream dos = new DataOutputStream( socket.getOutputStream() );
                   DataInputStream dis = new DataInputStream( socket.getInputStream() );
                   dos.writeInt( files.length );
                   for ( File f : files ) {
                        BufferedOutputStream out = new BufferedOutputStream( dos );
                        BufferedInputStream in = new BufferedInputStream( new FileInputStream(f) );
                        postStatusMsg( "Sending: " + f.getName() );
                        byte[] b = new byte[8192];
                        int read = -1;
                        dos.writeUTF( f.getName() );
                        while ( ( read = in.read( b ) ) >= 0 ) {
                             out.write( b, 0, read );
                        postStatusMsg( "File Sent" );
                        in.close();
                   dos.close();
                   postStatusMsg( "Closing Connection" );
                   socket.close();
                   postStatusMsg( "Connection Closed" );
              catch( IOException e ) {
                   Main.ShowMsgBox( statusTA, "Error", e.getMessage(), JOptionPane.ERROR_MESSAGE );
                   try {
                        e.printStackTrace( new PrintStream( "./log.txt" ) );
                   catch ( FileNotFoundException ee ) {
                        ee.printStackTrace();
         }The Server
    public class ServerHandler implements Runnable {
              private Socket s = null;
              public ServerHandler( Socket s ) {
                   this.s = s;
              public void run() {
                   try {
                        handlers.add( this );
                        DataInputStream dis = new DataInputStream( s.getInputStream() );
                        DataOutputStream dos = new DataOutputStream( s.getOutputStream() );
                        BufferedInputStream in = new BufferedInputStream( dis );
                        BufferedOutputStream out = null;
                        int count = dis.readInt();
                        for ( int i = 0; i < count; i++ ) {
                             File f = new File( Main.settings.SAVE_DIR );
                             if ( !f.isDirectory() )
                                  f.mkdir();
                             f = new File( Main.settings.SAVE_DIR + "\\" + dis.readUTF() );
                             out = new BufferedOutputStream( new FileOutputStream( f ) );
                             postStatusMsg( "Receving: " + f.getName() );
                             byte[] b = new byte[8192];
                             int read = -1;
                             while ( ( read = in.read( b ) ) >= 0 ) {
                                  out.write( b, 0, read );
                             postStatusMsg( "File Received" );
                             out.close();
                        in.close();
                        postStatusMsg( "Closing Connection" );
                        s.close();
                        postStatusMsg( "Connection Closed" );
                        handlers.remove( this );
                   catch ( IOException e ) {
                        Main.ShowMsgBox( statusTA, "Error", e.getMessage(), JOptionPane.ERROR_MESSAGE );
                        try {
                             e.printStackTrace( new PrintStream( "./log.txt" ) );
                        catch ( FileNotFoundException ee ) {
                             ee.printStackTrace();
         }

    Something like this, modulo bugs:
    // sender
    dos.writeLong(file.length());
    // send the file
    // receiver
    long length = dos.readLong();
    long current = 0;
    int count;
    while (current < length && (count = in.read(buffer, 0, (int)Math.min(buffer.length, length-current))) > 0)
      out.write(buffer, 0, count);
      current += count;
    }

  • Trying to make a text file of ITunes library

    I'm trying to make a list of my itunes library in any type of text file (word, notebook, notepad,etc). My ex sent me an old library this way just so that I could see what I already had at his place so I wouldn't duplicate things. How do I do this??

    In iTunes, use View > Options to show the fields you want to show. Then Edit > Select All, then Edit Copy.
    Open Word and use *Paste Special > Unformatted Text.*
    Try it first on a short playlist so you can see how it works.

  • HT4527 I am trying to transfer music files from one PC to another using homeshare and although I can view the music as a shared folder I cannot initiate the "import" process.  I have iTunes 11.0.1.12 on both computers so the help screenshots do not help a

    I am trying to transfer music files from one PC to another using homeshare and although I can view the music as a shared folder I cannot initiate the "import" process.  I have iTunes 11.0.1.12 on both computers so the help screenshots do not help as such

    Then stop trying to use HomeShare and use one of the other options listed in the document from which your question was posted.

  • I have problems with seeing my bookmarks, file, view, edit...buttons. I tried other shortcuts. I noticed that all of my bookmarks are located in the Internet Explorer browsers, how can I restore setting back to Mozilla Firefox?

    I have problems with seeing my bookmarks, file, view, edit...buttons. I tried other shortcuts. I noticed that all of my bookmarks are located in the Internet Explorer browsers, how can I restore setting back to Mozilla Firefox?

    Is the menu bar missing (the one containing File, View, Edit etc)? If it is, the following link shows how to restore it - https://support.mozilla.com/kb/Menu+bar+is+missing

  • I am trying to make a pdf of a file and I need to get the file size to be no bigger than 10MB. What is the best way to do this

    I am trying to make a pdf of a file and I need to get the file size to be no bigger than 10MB. Even when I save it, the image quality at minimum the file size is 10.9 MB. What is the best way to do this

    @Barbara – What purpose is that PDF for? Print? Web?
    If web purpose, you could convert CMYK images to sRGB. That would reduce the file size as well.
    A final resort to bring down file size is:
    1. Print to PostScript
    2. Distill to PDF
    That would bring file size down even more. About 20%, depending on the images and other contents you are using, compared with the Acrobat Pro method. If you like you could send me a personal message, so we could exchange mail addresses. I could test for you. Just provide the highres PDF without any downsampling and transparency intact. Best provide a PDF/X-4.
    I will place the PDF in InDesign, print to PostScript, distill to PDF.
    Uwe

  • Trying to copy ANY file from my MacBook Pro to an external hard drive spins for 45 minutes then fails. I hate this computer and WISH I never would have wasted my money. Any ideas? WD My Passport 2TB Drive, had to buy a program to make the POS write

    Trying to copy ANY file from my MacBook Pro to an external hard drive spins for 45 minutes then fails. I hate this computer and WISH I never would have wasted my money. Any ideas? WD My Passport 2TB Drive, had to buy a program to make the POS read files. Copies that would take seconds from a Windows based machine never complete. I have to close the transfer or shut off the machine half the time. Worst computer I have EVER owned, crashes non-stop, constantly freezes, and seems like EVERY operation is more complicated with this thing. Literally, my 1997 Compaq was FAR MORE reliable and user friendly.

    This is one of the messages I keep getting; The Finder can’t complete the operation because some data in -- File Whatever -- can’t be read or written.(Error code -36)
    I have copied things to the hard drive in the past, but it has always been incredibly slow, and now just seems to freeze and fail

  • I am getting this response when I am trying to open a file: Before viewing PDF documents in this browser you must launch Adobe Reader and accept the End User License Agreement, then Quit and relaunch the browser."  What do I do?

    I am getting this response when I am trying to open a file: Before viewing PDF documents in this browser you must launch Adobe Reader and accept the End User License Agreement, then Quit and relaunch the browser.”  What do I do?  I have opened this up in the past without a problem. 

    Back up all data.
    If Adobe Reader or Acrobat is installed, there should be a setting in its preferences such as Display PDF in Browser. I don't use those applications myself, so I can't be more precise. Deselect that setting, if it's selected. Otherwise do as follows.
    Triple-click anywhere in the line of text below on this page to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have "Adobe" or “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present. The same goes for a plugin called "iGetter," and perhaps others.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • HT1925 I was trying to make sure that all my Apple software was uninstalled, and I still can't remove C:\Program Files\iPod\.  I went to the Task Manager and it is not listed in the Processes tab.  What do I do now?

    I was trying to make sure that all my Apple software was uninstalled, and I still can't remove C:\Program Files\iPod\.  I went to the Task Manager and it is not listed in the Processes tab.  What do I do now?

    Are you looking for iPodService.exe?
    Might be better to run services.msc from the run dialog and shut down the service polietly.
    tt2

  • I get this message "Cannot save the file as the font "ArmenianLSU-italic" could not be embedded because of licensing restrictions. Turn off the pdf compatibility option and try again. I have this file from when I had CS4. It worked then. I trying to make

    I get this message when I am trying to save a file that was done in CS4, now using  CS6 "Cannot save the file as the font "ArmenianLSU-italic" could not be embedded because of licensing restrictions. Turn off the pdf compatibility option and try again." Even if I start a new file I unable to save it with this font. I need to use this font.

    Then you need to outline all text before savng the PDF.
    Make sure you do this on a copy of the file.

  • I am trying to make a signature in MS Word (2007) which includes a jpg image, but when I save it as a HTML file and attach it the text appers OK but the image doesn't. I have tried various formats but still no luck. Can anyone help?

    I am trying to make a signature in MS Word (2007) which includes a jpg image, but when I save it as a HTML file and attach it the text appers OK but the image doesn't. I have tried various formats but still no luck. Can anyone help? edit

    C'mon! Anyone???? I'm desperate!

  • HT3702 I purchased a book called Activity-based costing for $3.99. I tried to open the file but it said my computer does not have IOS. I have a smartphone and I am unable to view the book. I am requesting since I am unable to use the book activity-base co

    I purchased a book called Activity-based costing for $3.99. I tried to open the file but it said my computer does not have IOS. I have a smartphone and I am unable to view the book. I am requesting since I am unable to use the book activity-base costing, a refund.
    Kevin

    I don't know what you are saying. How do I get my money refunded.

  • I am trying to make a Shell call to Firefox in the C:\Program Files (x86)\Mozilla FireFox\ directory and LabView shell call gives an error.

    I am trying to make a Shell call to Firefox in the C:\Program Files (x86)\Mozilla FireFox\ directory and LabView shell call gives an errors. I can go to the DOS shell and make the call fine, but Labview Shell gives several errors. Anyone know how to get around the directory issue with Program Files (x86) directory name having the space in it and the (x86) that DOS does not seem to like?
    Solved!
    Go to Solution.

    You need to use quotes.

  • What makes a file unreadable or readable when trying to move it into the library

    What makes a file unreadable or readable when trying to move it into the library

    Any more info? It could be many things including what you are doing - you do not "move" anything to the iPhoto library - you use iPhoto (or image capture) to "import" into iPhoto
    We know nothing except what you tell us so full information and correct terminology is critical to getting valid answers - the more that is left to one guessing and assuming the better the chance of a bad answer
    LN

Maybe you are looking for

  • HT1267 The Apple ID in my new IPhone is not the same as my ID . how can i sort this

    Hi, The Users ID on My New IPhone Is not the same as my apple ID How can I sort this ...

  • Where to find TV-out adapter?

    I've been looking online for a week straight trying to find ANYTHING that will work in the TV out of my gf4 ti4200 64mb card.   Im desperate, if anyone knows anything about trying to get one of these, plz let me know!! Thanks!

  • What format is best to choose for importing to iTunes 11?

    Trying to import all my music from Windows XP laptop, (can't find my original CDs, packed away) hours later I found they were in WMA format, not acceptable to iTunes in new Mac Mini, What the? Tell me best choice for format, please? I wasn't thrilled

  • Use EVALUATE_PREDICATE function as filter in an anlysis

    Hi guys, I'm struggling to get the proper syntax to use the EVALUATE_PREDICATE as a filter on a column in an OBIEE analysis. I'm using an EVALUATE function to determine the rank of 'Test Naam' in the result set (CAST(EVALUATE('DENSE_RANK() OVER (PART

  • Correlation using file name

    Hi all i have a scenario where I have to place a file at target with a particular file name, say, my_name_is_itisha.txt .After the target processes the file,it places an acknowledgement file with the name my_name_is_itisha_txt.ack. In short, the ack