In order to use NativeViewer with Visual Studio prior to 2010, you should install it manually. The steps are as follows:
- Download and install Microsoft Visual C++ 2010 Redistributable and Microsoft .NET Framework 4 (you don't need to install it, if you already have Visual Studio 2010 installed on your computer).
- Download the latest VSIX package for Visual Studio 2010.
- Unpack the VSIX package somewhere on your disk. The *.vsix file is just a ZIP package, so use your favorite utility to unpack it (you may need to change extension from vsix to zip). We will refer to the directory you unpacked the package to as <install_dir>.
- Open the autoexp.dat file for you Visual Studio. It is usually located at
C:\Program Files (x86)\Microsoft Visual Studio <your_vs_ver>\Common7\Packages\Debugger\autoexp.dat
- Under the [AutoExpand] section add the following line (no quotes for <install_dir>, but spaces are allowed):
cv::Mat=$ADDIN(<install_dir>\NativeViewer10.dll,CvMatViewer)
- Launch Visual Studio, open your solution and start a debug session. Chose a variable of cv::Mat type storing 2-D matrix with CV_TYPE equal to CV_8UC1 or CV_8UC3. Hold down the CTRL key, and hover a mouse over the variable in the code editor window. A thumbnail image should pop up at this moment.
- To change NativeViewer's behavior, locate the NativeViewer.xml file in <install_dir> and edit it. You don't have not restart Visual Studio for changes to take effect, but you have to restart a debug session.
If instead of a fancy image you only see the error message "Could not load file or assembly ..." (like here), try the following:
- Locate the file <install_dir>\NativeViewerGUI10.dll, open it's properties, at the bottom of the General tab click "Unblock" (as described here). If you don't see the "Unblock" button, the assembly is not being blocked so it's already fine.
- Locate the Visual Studio executable config file devenv.exe.config, it usually at
c:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\devenv.exe.config
Add the following setting to it (as described here):
<configuration>
<runtime>
<loadFromRemoteSources enabled="true" />
</runtime>
</configuration>