Leap Motion的环境配置(使用c#)
来源:互联网 发布:pplive网络电视2015 编辑:程序博客网 时间:2024/06/10 08:45
开发用的sdk和驱动程序从这里下载https://developer.leapmotion.com/
官方的开发者文档在这里https://developer.leapmotion.com/documentation/index.html?proglang=current
(我用的是电信的宽带 ,上面两个链接需要翻墙才能打开)
官方下的sdk是个压缩包,解压到任意目录即可,解压后安装里面的那个安装程序
sdk里的dll文件在这里
根据所使用的.net版本来添加引用
vs里的平台也要改为x86或x64,然后把上图中对应文件夹里的文件复制到程序所在目录里就可以了,如果没有复制进去,会出现'Leap.LeapPINVOKE'的报错。
最后,附上官方的原话:
Creating a project in Visual Studio
This section illustrates how to create a project from scratch. Most of the steps also apply to adding Leap Motion support to an existing project. The example uses Visual Studio 2012.
To add Leap Motion support to a new or existing project:
Important: If you are creating a 64-bit application, use the libraries in the lib\x64
directory of the SDK, not the 32-bit libraries in the lib\x86
directory.
Open or create a new project of the desired Windows Forms or WPF type.
Make a
LEAP_SDK
system environment variable to point to your Leap Motion SDK folder. This step is optional, but does simplify creating references to the SDK files in your projects. (As a reminder, you can create and change system environment variables from the Windows System Properties dialog.)Add a reference to the Leap Motion .NET library that you wish to use.
Select Project > Add Reference.
In the References dialog, select Browse.
Browse to your Leap Motion SDK folder.
Choose either
LeapCSharp.NET3.5.dll
orLeapCSharp.NET4.0.dll
. Both libraries support the full Leap Motion API, but you should choose the one appropriate for the version of .NET you are using in the project.Note: do not add any of the other Leap Motion library files as a reference.
Set the target platform to x86 or x64:
- Open the project properties page with Project > ProjectName Properties.
- Select the Build page.
- Set the Configuration to All Configurations.
- Under General, set Platform target to either
x86
orx64
. Do not use theAnyCPU
target.
Edit the Post Build Event to copy the native libraries to the project’s target executable directory.
Open the project properties page.
Select the Build Events page.
Click Edit Post-build...
Edit the event field to copy the libraries.
For 32-bit, x86 projects add:
For 64-bit, x64 projects add:
Note: if you didn’t create the LEAP_SDK environment variable, use the path to your SDK library in place of
$(LEAP_SDK)
.
Add your source code...
Note: If you get the error, TypeInitializationException:Thetypeinitializer for 'Leap.LeapPINVOKE' threw an exception
, when you run your project, then the Leap Motion .NET code is not finding the correct native libraries. This can happen if you forget to copy Leap.dll
and LeapCSharp.dll
to the same directory as your executable or you copy the wrong version (64-bit instead of 32-bit or vice versa). The error can also occur if you use the AnyCPU
target platform.
- Leap Motion的环境配置(使用c#)
- Leap Motion环境配置(C++)
- Leap Motion C++环境的配置
- leap motion VC环境配置
- Leap Motion开发第一步环境配置
- 实战基于Leap Motion体感外设使用Win32(VC++)环境配置
- 使用C++开发Leap Motion应用程序——Windows下开发环境配置
- [Leap Motion开发系列]win32应用的环境配置[2013-11-2更新]
- Leap Motion C++开发笔记(一)下载安装及环境配置
- Leap Motion 入门一:VS上环境配置
- Leap Motion开发环境配置LeapmotionDevelopmentKit3.2.0+VS2013
- Leap Motion 的原理
- 使用Leap Motion可视化工具
- 使用C#开发基于Leap Motion的手势控制应用(一)
- 使用C#开发基于Leap Motion的手势控制应用(二)
- Leap Motion 的原理(转)
- (0)Leap Motion简介
- LEAP环境如何使用和配置RestService
- C#中[],List,Array,ArrayList的区别于应用
- 常见邮件服务器(接收服务器和发送邮件服务器)地址
- 去除csv文件单元格内的逗号
- 网页设计的几大趋势
- 【Mac版】串口开发搭建环境步骤
- Leap Motion的环境配置(使用c#)
- java内部类学习笔记
- 深度优先搜索(Depth-First-Search)
- Leetcode: Remove Linked List Elements
- linux常用命令二之权限,搜索与帮助命令
- IIS下安装PHP
- Android APK安装常见错误列表
- 链表操作
- [ios]the file couldn't be opened because you don't have permission to view it