Home Forums Software Development [Solved] vb.net Reply To: [Solved] vb.net

#2501
Patrik [Tobii]
Participant

I’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