Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Scale Entire Image from Grab2CW to fit CWIMAQViewer in VC++.net

Using
NationalInstruments.CWIMAQ1394.Interop.dll (Version 2.0) and
NationalInstruments.AxCWIMAQControlsLib.Interop.dll (Version 7.1.1.0)
with
Microsoft VC++.net 2003

Have a CWIMAQViewer Control on my form that is (640 x 480)
MY cam0 acquires an Image at (1280 x 960 @ 7.5 fps)

The maximum region the camera can acquire is important!

Want to scale the image to fit into the control.

Thank you
0 Kudos
Message 1 of 6
(3,830 Views)
Hi there,

In order to display your larger image in the IMAQViewer, I would recommend the CWIMAQViewer.ZoomScale property. This property will resize your image without altering your image data.

If retaining the same image data is not of utmost importance, the CWIMAQVision.Rescale2 method will allow you to reduce or enlarge an image.

These two functions can be found in the IMAQ Vision for Visual Basic Function Reference, which should be installed with IMAQ Vision. I hope it helps!

Robert Manion
Applications Engineering
National Instruments
0 Kudos
Message 2 of 6
(3,822 Views)
Thanx
0 Kudos
Message 3 of 6
(3,817 Views)
Hi, I am trying to do this same thing with C# .NET. Unfortunately, I can't find any documentation for what kind of values the ZoomScale property takes (int, Int32, some enum property in the library?). So two things: a) can you tell me what kinds of values it takes and b) I've been looking for this supposed IMAQ Vision for Visual Basic Reference forever; I can't find it on the CD, it hasn't been installed (I did a full installation, I made sure myself), and I can't find it on the NI website...can you email it to me?
0 Kudos
Message 4 of 6
(3,799 Views)
I found out what I need to know about ZoomScale. The answer wasn't stated in a manner that allowed people to search for it so for the sake of future visitors, dig in:

the zoomscale property for the imaq image viewer only takes integers where a positve number denotes zooming in or increasing the image size and negative numbers donote zooming out or decreasing the image size. For instance, setting ZoomScale to 2 will increase the image size to 2x. For some given negative number k, the resulting zoom scale will be 1/(-k+1). ie. -1 will give you an image of half the size: (1/(-(-1)+1)).

As for the document, it seems like everyone is talking about it but no one has it, so if you have it, please post it! Thanks.

Message Edited by aroon on 06-13-2005 03:01 PM

0 Kudos
Message 5 of 6
(3,797 Views)
Aroon,

Glad you figured it out. Next time I will post my solution in detail to help other possible thread viewers.
0 Kudos
Message 6 of 6
(3,792 Views)