8 of 10
8
CsTI - CSharp Touchlib Interface
Posted: 17 September 2008 06:02 PM   [ Ignore ]   [ # 106 ]
New Member
Rank
Total Posts:  3
Joined  2008-09-17

I’m having trouble getting this to work, I’ve got the WPF controls running and could call startTracking which opened the camera config stuff. It won’t register any finger events though, could anyone give me a simple example of the WPF? I’m assuming i need to replace my Window with a TouchWindow (not sure how to do that in the xaml) then do I call startTracking from the ContentRendered event?

Thanks

Profile
 
 
Posted: 17 September 2008 06:19 PM   [ Ignore ]   [ # 107 ]
New Member
Rank
Total Posts:  3
Joined  2008-09-17

ok i’ve figured out the window base class, i was getting confused because the window isn’t in the controls namespace like all the others.

Now I see the TouchWindow has it’s own ContentRendered handler with startTracking, but then it’s immediately followed with “this.Close();” which closes the app. Not sure why.

Profile
 
 
Posted: 24 September 2008 06:47 AM   [ Ignore ]   [ # 108 ]
New Member
Rank
Total Posts:  1
Joined  2008-09-24

i have the same problem, as soon as i run the console application it does the same as the config app in the touchlib package only it closes immediately.

Profile
 
 
Posted: 11 November 2008 04:51 PM   [ Ignore ]   [ # 109 ]
New Member
Rank
Total Posts:  52
Joined  2007-12-05

Hello All,

I am trying to use CsTI in a C# Windows Forms application and the problem that I have is that once the application loop is on, it doesn’t capture touch events and if startScreen() is called, the application doesn’t get updated.
I tried to put startScreen() in a thread, but then the weird thing is that the finger down event gets called all the time, so it is like the finger update event. So thats no good.

Could anyone give me a hint how to use CsTI in a Forms application please?

Thanks a lot.

Greg

EDIT: Ok, you can forget that. I understand now how it works.

Profile
 
 
Posted: 12 November 2008 03:32 PM   [ Ignore ]   [ # 110 ]
New Member
Rank
Total Posts:  52
Joined  2007-12-05

Does anyone have the sources of CsTI that include the stopScreen() method? If you have it, could you please upload it here?
Thanks
Greg

Profile
 
 
Posted: 19 November 2008 10:05 AM   [ Ignore ]   [ # 111 ]
Sr. Member
RankRankRank
Total Posts:  335
Joined  2007-03-13

Hi Gregi, I believe you are the one who I replied to?

I’m back into multitouch so I’ll be answereing all of your questions ASAP! Let me know if anyone still has the problems concerning CsTI.

 Signature 

multitouch south africa
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 20 November 2008 06:38 AM   [ Ignore ]   [ # 112 ]
New Member
Rank
Total Posts:  6
Joined  2008-11-20

Hello Community,
I am new to this community. Everyone wants these Multi-Touch Surfaces these it seems. Of course I wanted one too then. I found that great video about how to build a simple MT. I have modified that to make it a little bit more solid and with some configuration I got the Smoke Demo running and giving pretty good results (for my standards presumably).
So far I have limited coding skills and only a basic understanding of the matter itself, but I am sure this will change. I am using C# with Visual Studio 2008. I have read this thread thoroughly and with great interest. Before I ask my question I would like to give thanks to all of you for putting your knowledge and experiences up here.
I have basically done what it takes I suppose.
1.) Created a new console project
2.) Named it after the namespace in the sample program
3.) Copied the .dll files into the bin folder
4.) Added the reference to CsTI.dll
5.) Pasted the code of the Program.txt that was posted latest into VS
6.) Hit the debug Button.
No Errors, nothing. The console application and some other windows are popping up and immediately closing again.
I’m sure it’s something very basic, but does someone have an idea on what this might be?
Thx

Profile
 
 
Posted: 20 November 2008 07:17 AM   [ Ignore ]   [ # 113 ]
Sr. Member
RankRankRank
Total Posts:  335
Joined  2007-03-13

Hi Maik, It sounds if you did everything you need to. I’m on the road at the moment, when I get home I’ll follow your steps to see if there is anything I didn’t explain. Are you using touchlib beta 2? The one available here -> http://nuigroup.com/touchlib/downloads/

 Signature 

multitouch south africa
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 20 November 2008 07:20 AM   [ Ignore ]   [ # 114 ]
New Member
Rank
Total Posts:  6
Joined  2008-11-20

Hi donovan, yes, that is the one I’m using. Thank you for your quick reply. Greetings

Profile
 
 
Posted: 20 November 2008 07:39 AM   [ Ignore ]   [ # 115 ]
New Member
Rank
Total Posts:  6
Joined  2008-11-20

This is all I’m getting, but as I said, there is another window briefly showing. Unfortunately I’m not quick enough to capture it.

Image Attachments
Screenshot.jpg
Profile
 
 
Posted: 20 November 2008 01:25 PM   [ Ignore ]   [ # 116 ]
Sr. Member
RankRankRank
Total Posts:  335
Joined  2007-03-13

oh, welcome to the community Maik! I’ve done what you did and it’s working for me. Are you using the latest CsTI? available from http://www.whitespaced.co.za ? What framework are you targeting?  .NET 2/3/3.5?

 Signature 

multitouch south africa
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 20 November 2008 01:26 PM   [ Ignore ]   [ # 117 ]
Sr. Member
RankRankRank
Total Posts:  335
Joined  2007-03-13

oh, and you are using the config.xml file that is already configured when testing with CsTI right?

 Signature 

multitouch south africa
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 21 November 2008 05:23 AM   [ Ignore ]   [ # 118 ]
New Member
Rank
Total Posts:  6
Joined  2008-11-20

Thanks again for the quick response.

Well here is what I found out. When I insert something and” Console.ReadKey()”; into the catch method I can see that it goes there, which is not suprising at all, since I knew that something went wrong. Anyway, I get to the point, where I can specifie resolulution, and so on. The screens for calibration will also show, but then it freezes to no response. In the console window it writes:

Recap
frame received
SCREEN SHUTTING DOWN

I get the debug error message:

A first chance exception of type ‘System.AccessViolationException’ occurred in CsTI.dll

And the Warning:

Referenced assembly ‘bin\CsTI.dll’ targets a different processor than the application.

I am using a modified config.xml from the beta v2 version, which had to be modified in order to use my external webcam and not the one build into my laptop. It does work fine when I use it with the configuration tool from Touchlib. I think it should work then, shouldn’t it? I am using the same one in VS.
I am also using the right CSTItouchlib_beta2bins i think, to make sure I downloaded them again from the above location and checked again.
I am targeting .NET 2.0 at the moment, but played around with that also, after your suggestion, and it didn’t seem to make any difference.

Any Idea what might be the problem? Thanks in advance.
maik

Profile
 
 
Posted: 21 November 2008 05:56 AM   [ Ignore ]   [ # 119 ]
Sr. Member
RankRankRank
Total Posts:  335
Joined  2007-03-13

No problem. From what I know of how I wrote this is that processes from .NET to c++ need to bind in the same thread. Although this might not be the exact case at the moment here are two things you could try:

1.  Add

[STAThread]

just above

static void Main(string[] args)
{
       CsTI cs 
CsTI.Instance();

so that it looks like

[STAThread]
static void Main(string[] args)
{
     CsTI cs 
CsTI.Instance();

that will force it to use Single Threaded Architecture.

2. If that does nothing, check that you are targeting the x86 platform. I haven’t done any testing on 64bit systems with it.
To ensure that do the following:

- Right-Click on your application name in Visual Studio’s solution explorer and choose properties.
- Go to the Build tab
- Change the ‘Platform Target’ to x86.
- Then rebuild.

If none of this works, attach your project here then I can have a look at what happens

 Signature 

multitouch south africa
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 21 November 2008 06:37 AM   [ Ignore ]   [ # 120 ]
New Member
Rank
Total Posts:  6
Joined  2008-11-20

Well some things could be so easy.
I did the changes. Warning disappeared! Access Violation remained!
I copied whole project to another drive and…
It works. It seems that my Visual Studio, even though it is run with administrator privileges, and I am the administrator, is not allowed opening and/or changing the config.xml.  Which causes the error ergo will let the application crash.
So I got it to run for now. Thanks a lot. I will work with that and keep you updated. I am certain that I will run into a “couple” more questions smile
maik

Profile
 
 
   
8 of 10
8