01-28-2013 03:05 PM
I find several examples for image capture ( Snap, Grab, etc) written for vb6 and c++, but not a single example using vbnet. Am I missing something?
Solved! Go to Solution.
01-29-2013 08:04 AM
This code takes a full screen screenshot and saves it to a specified file location:
Dim bmpSS As Bitmap
Dim gfxSS As Graphics
bmpSS = New Bitmap(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
gfxSS = Graphics.FromImage(bmpSS)
gfxSS.CopyFromScreen(Screen.PrimaryScreen.WorkingArea.X, Screen.PrimaryScreen.WorkingArea.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy)
bmpSS.Save("C:\sample.bmp", System.Drawing.Imaging.ImageFormat.Bmp)
01-29-2013 03:26 PM
I guess I was not specific enough. I have Vision Development Module and SCA640 70 gm GigE camera using NI IMAQdx driver. I want to snap or grab an image from camera and then process image. Apparently Active X NIDAQ control only works with IMAQ but not IMAQdx driver required by GigE camera. NI has info on using capture software, but no info that I can find on doing this in VB without using Active X controls.
01-30-2013 06:15 PM
.NET examples are shipped with our vision acquisition software, however you must specify that you would like the examples installed during installation. Usually this option will automatically be selected if the installer can see you already have the development environment installed. In order to install the NI-IMAQdx and other image acquisition driver examples you would need to perform a repair/install for the software and select the examples to be installed. First you would need to go to Windows control panel->programs and features:
Next select National Instrumenst Software the click 'Uninstall/change'. The following window should pop up.
Select NI-IMAQdx and click MODIFY
Select to install the examples under .NET Languages support. After the examples are installed they should be located under:
Start >>Programs>>Nationals Instruments>>Vision>>Text-based Examples>>NI-IMAQdx>>dotNET Examples