From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 hours finished the webcam program

Hey Mike,

 

I'm having trouble getting the saved image to have the same view as the view shown on the VI (see attached).  I tried looking through the sub-VIs but the deeper I go, the more complicated the code gets.  I just want both windows to look the same so that the window seen first is the image captured by the webcam.  Any help/advice you can give would be wonderful.

 

Thanks,

James

0 Kudos
Message 41 of 84
(8,802 Views)

I've actually figured it out! Thanks!

0 Kudos
Message 42 of 84
(8,799 Views)

So what did you do ?

 

It will help others if you explain how you have fixed your problem.

0 Kudos
Message 43 of 84
(8,792 Views)

I ended up just removing that window on the front panel, since it was only showing a window of the actual webcam image (still not sure why that is...).  I just used the 'write JPEG file' function to save the picture file, which when opened displayed the correct image.

0 Kudos
Message 44 of 84
(8,767 Views)

Hey guys,

 

I'm working on this again... Now I want to be able to turn this into a subvi that automatically takes a picture using the webcame and saves the file.  I've removed the while loop and the 'get' button, which works properly.  But then, when I turn the VI into a subVI and test it in another VI, it doesn't work... 

 

I'm thinking it has something to do with actually displaying the live stream.  I don't need this feature anymore anyways, so is there an easy way to remove it? I've been toying around, removing chunks of code, but it only makes the program crash.

 

Thanks,

James

0 Kudos
Message 45 of 84
(8,641 Views)

Mike's program makes 2 windows for the video.  Sometimes my video appeared in one, sometimes in the other.  I think it's because both windows are declared in the same frame without specific order of execution.  I removed the second window and the associated code.  I also removed the cases that don't execute due to the constant on the case selector.  I used Write PNG File function from the Graphics and Sound > Graphics Formats pallette to save the image.  It works great!   Interestingly, the "Picture" image only shows a corner of the video image, but the saved file has the full image.  I have LabVIEW 8.5 FDS and Windows 7 Professional 64-bit.  My camera is a video microscope.  Thanks, Mike and Kangkang!  Next I'll try to put this into another VI...

0 Kudos
Message 46 of 84
(8,405 Views)

Hi Mike, James, and others who have tried to use this program...

Before putting an edited version of Mike's program into another VI, I tried "building" it as an application.  The application gives 8 empty dialog windows which close when I press the <CR> key.  Then it crashes.  So I tried building just one of the SubVIs - FindWindowA - as an application.  This one crashes with no dialog box at all.  I use AB every day and haven't seen this before.  LabVIEW 8.5 on Windows Pro 7 64-bit.  Anyone have ideas?  Thanks.  Halden

0 Kudos
Message 47 of 84
(8,383 Views)

It turns out to have something to do with the dlls!  The Application Builder made avicap32 and user32 dll files and put them in a folder called "data" for use by the executable program.  I suspected that maybe these dlls were special, since they're in the OS.  So, I found the ones in the Windows>System32 folder and made "shortcuts" to them.  I moved the shortcuts to the "data" folder and removed "Shortcut" from the name.  It works!  But gee, it'd be great if LabVIEW could provide a more informative error message for situations like this.  The only content in the blank dialog boxes is that the first one had a white interior, the next 7 grey, and they had slightly different sizes.  -Halden

0 Kudos
Message 48 of 84
(8,372 Views)

Don't do this at all! Just remove the DLLs in the data folder altoghether. The reason LabVIEW adds them in a built is, that when someone edited those VIs he probably browsed to the DLL in the system32 directory and confirmed the file dialog. This enters the entire path to the DLL into the Call Library Node. But a full path is an indication to the LabVIEW application builder that the DLL is a private build and should be added to the built application.

 

However ALL DLLs in system32 (and possibly windows) directory are either Windows DLLs or are installed by a specific software installer and should never get copied to the application directory. This is especially true for all the Windows DLLs such as kernel32, gdi32, user32, avicap32 etc.

 

The proper fix is therefore to go into all Call Library Nodes and make sure that the library path contains just the DLL name without any other path component. Then the application Builder will not add those DLLs to the build anymore and your application will be fine.

Rolf Kalbermatter
My Blog
Message 49 of 84
(8,360 Views)

It is possible to have a version for LabView 8.0?

0 Kudos
Message 50 of 84
(7,913 Views)