Home › Forums › Software Development › [Solved] vb.net
Tagged: eye tracking, vb.net
- This topic has 25 replies, 7 voices, and was last updated 6 years, 1 month ago by
Grant [Tobii].
- AuthorPosts
- 06/02/2015 at 16:13 #2483
David Thomson
ParticipantAs a newcomer to the forum, has anybody got any basic vb.net code that they are willing to share?
09/02/2015 at 11:34 #2501Patrik [Tobii]
ParticipantI’m sorry that we currently do not have any examples targeting VB.NET.
If you want to get started as soon as possible with the EyeX SDK using VB.NET, I would recommend a service like Telerik’s Code Converter. Using a service like this, you can simply convert the C# code examples or source code on this forum to VB.NET.
In the meanwhile, here is my contribution 🙂
'----------------------------------------------------------------------- ' Copyright 2014 Tobii Technology AB. All rights reserved. '----------------------------------------------------------------------- Imports EyeXFramework Imports Tobii.EyeX.Framework Module Program Public Sub Main(args As String()) ' Create the EyeX host Using eyeXHost = New EyeXHost() ' Create a data stream: lightly filtered gaze point data. ' Other choices of data streams include EyePositionDataStream and FixationDataStream. Using dataStream = eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered) ' Start the EyeX host. eyeXHost.Start() ' Write the data to the console. AddHandler dataStream.Next, AddressOf OutputGazePoint ' Let it run until a key is pressed. Console.WriteLine("Listening for gaze data, press any key to exit...") Console.ReadKey(True) End Using End Using End Sub Private Sub OutputGazePoint(sender As Object, e As GazePointEventArgs) Console.WriteLine("Gaze point at ({0:0.0}, {1:0.0}) @{2:0}", e.X, e.Y, e.Timestamp) End Sub End Module
09/02/2015 at 16:22 #2504David Thomson
ParticipantThanks for your help.
Nearly there but AddHandler dataStream.[Next] is creating an error?
11/02/2015 at 16:15 #2516Patrik [Tobii]
ParticipantHello David,
I’ve updated the example. Since the
[
and]
characters surrounding theNext
property just is a way of telling the compiler that “I know that this is a keyword, but I want to use it anyway” (just like the @-prefix for variables in C#), and since it’s not actually needed here, you should be able to delete those characters and it should compile.It’s strange that you get a compilation error though.
What does the error say?/ Patrik
25/02/2015 at 22:48 #2617Meir Naiman
ParticipantHow did yo include the EyeXFramework in your vb.net project?
02/03/2015 at 10:14 #2636Patrik [Tobii]
ParticipantHello Mehr,
There are two ways you can go to include the EyeXFramework in your VB.NET project.
1. Compile the framework yourself and add a reference to the compiled assembly.
2. Add the EyeXFramework C# project to your solution (it’s OK to mix them) and reference the project directly./ Patrik
02/03/2015 at 13:57 #2640Meir Naiman
ParticipantThank you for your reply, i will try both and see which works better for me.
15/12/2015 at 22:24 #3924Aniket Sakinala
ParticipantHi, I’ve tried to reference the ‘Tobii.EyeX.Client.dll’ provided in the TobiiEyeXSdk-DotNet-1.5.466 in one of my VB.NET project but I get an error that the reference could not be added. Please help.
16/12/2015 at 19:17 #3938Jenny [Tobii]
ParticipantHi Aniket,
It sounds like you are trying to add the Tobii.EyeX.Client.dll as a managed dll. You cannot do that, since it is a native dll. I know how to add it in a C# project and I’m guessing it should be similar in VB.NET (though I have never tried).
Check out this forum topic and the solution I proposed there:
http://developer.tobii.com/community/forums/topic/tobii-eyex-sdk-setup-c/If that doesn’t work, I suggest you google “reference native dll vb.net”.
16/12/2015 at 19:33 #3940Aniket Sakinala
ParticipantThanks Jenny, that seemed to have fixed it.
The other problem I’m facing is that the Tobii EyeX Engine is not connecting to the eye tracker(The icon tray says it’s not connected). It works in the Tobii Studio but I can’t get it to work in any .NET projects. The projects compile but there’s no detection.
13/04/2016 at 17:54 #4999David Thomson
ParticipantYou previously provided a snippet of VB.net code for the EyeX API. Could you get me going with a similar snippet for the Gaze API. I cannot seem to find any documentation on this.
18/04/2016 at 10:10 #5051Grant [Tobii]
KeymasterHi @profthomson, unfortunately we do not have a visual Basic sample for the Gaze API as this is not a supported binding.
Hopefully the existing sample you have of EyeX can point you in the right direction.
14/08/2017 at 16:14 #7271Doug Livingstone
ParticipantDear Tobii
As a newbie and getting started with an EyeTracker 4C, it would be great if you could post additional articles/code about using the VB.Net and the EyeTracker
regards
Doug Livingstone14/08/2017 at 19:49 #7272Grant [Tobii]
KeymasterHi @mndcommunicate, thanks for your suggestion however for the time being we are not targeting VB.Net development within the new Tobii Core SDK.
That being said, you can still follow the instructions above in this thread for converting our supplied eye tracking sample applications from C# into VB.net compatible code if necessary.
I would recommend you start by running the code above to get up and running and thereafter consider code conversion for the more advanced samples… did you already go through these procedures without success?
15/08/2017 at 06:28 #7273Doug Livingstone
ParticipantThanks Grant
I have been able to run the programs from the TobiiEyeXSdk-Dotnet-1.8.498. In particular I thought the GazeAwareForms program suited me as a start point. However using the Telerik utility I have not been able to successfully convert it to VB.Net. If anyone else has performed this conversion I would appreciate the advice. That applies to the other dotnet programs, as such examples would get me started.
Regards
Doug - AuthorPosts
- You must be logged in to reply to this topic.