Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

cwimaq vs imaqdx image data structure

Solved!
Go to solution

I am using VB.net(2005) in a simple firewire camera snap and save application.  I have used CWIMAQ com objects before in VB6 without issue (using the WriteImage function).  I have done extensive machine vision work in VB6 with the CWIMAQ, so I know those tools, my trouble is now I am trying to port to VB.net.  

 

Currently, I cannot get the snap image dotnet examples to function with the CWIMAQ objects in dotnet.  I have tried the examples included with the NI Vision Aquisition tools and only have had success with the C# examples for imaqdx, not CWIMAQ. The legacy VB6 examples port to .net, however there are some usage issues with the COM structure that I am not smart enough to overcome in .net. 

 

Here is my problem, and maybe there is a simple solution.  I need to save the image and cannot for the life of me find the method for imaqdx which was similar to the cwimaq.writeimage function.  I have the imaqdx snap working in vb.net, I tried to use the CWIMAQ.writeimage but of course I get an "implicit conversion" error between the CWIMAQ image and the imaqdx image data structures. Can I cast the the imaqdx.image as system.forms.drawing image?

 

Is there an easy way to save an image using the imaqdx tools in VB.net similar to the way we used CWIMAQ.WriteImage?  Can someone point me to an example, or a thread which shows this? 

 

Thanks,

 

James

 

 

 

0 Kudos
Message 1 of 4
(3,521 Views)
Solution
Accepted by topic author vb.net.hell

Hi James,

 

The write functions are methods of the Vision image. For example, to save the image as png, you would call

imageViewer1.Image.WritePngFile

 

Our text based languages examples can be accessible from the Start Menu (Programs>>National Instruments>>Vision>Text Based Example)

 

Hope this helps,

 

-Christophe

Message 2 of 4
(3,519 Views)

Thanks for the reply, exactly the information that will help, however I still have a few un-solved mysteries.

 

For some reason, I don't have Text Based Examples where you refered me too. In users/public/National Instruments I have NI-XXXX examples where I found the c# examples that eventually worked for me and in Program Files(x86)/National Instruments/Vision I only have

 

/documentation

/dotnet

/include

/library

/utilities

NIVisSvr

 

I will give ImageViewer.Image.WritePngFile a try and let you know. Thinking I was stuck with my older vb6 code, I just went through the rather painful process of trying to set up a vb6 development environment with the older imaq1394 and cw on a windows 7 machine... not advisable.

 

If this pans out, I will be all set, however, maybe you or someone knows why the imaq1394.dll will not register properly via regsvr32 in windows 7.  Everything else, cwimaq and related com objects (ocx), seems to work fine.  Besides the Win7 UAC issues, the imaq1394.dll refuses to load/register which is keeping me from running my VB6 code on windows 7.

 

James

 

 

0 Kudos
Message 3 of 4
(3,512 Views)

Thanks Christophe - this works fine regarding the difference between cwimaq.writeimage and imageviewer.image.write. 

 

Not sure why text based examples was not installed with NI Vision Aquisition, but that is for another post along with my imaq1394.dll problems.

 

I don't know if it is just me, but searching the manuals, forums, and google seems like it would have turned this up, but alas, here it is for everyone else.

 

James

 

0 Kudos
Message 4 of 4
(3,507 Views)