3 of 3
3
WPF Multitouch Framework
Posted: 06 June 2008 06:56 AM   [ Ignore ]   [ # 31 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  474
Joined  2006-11-09

wow great job Jurbo… that looks great smile keep up the great work!

 Signature 

~

Profile
 
 
Posted: 07 June 2008 11:06 AM   [ Ignore ]   [ # 32 ]
New Member
Rank
Total Posts:  5
Joined  2008-06-02

I’ve just tested your framework and it works fine! Super! grin

Regarding fingerposition-visualisation via ellipses:
It seems that

el.IsHitTestVisible false;

really doesn’t work.
But you can skip the fill of the ellipse and just use the stroke.
It isn’t elegant and doesn’t solve the general problem, but it works grin
In _processing_FingerNew(...) I also get an exception.
Like Calvin already said, maybe FingerMoved is called before FingerNew.
So my current solution looks like this:

public partial class Window1 Window
{
  
...
  
Hashtable ellipseHash;
  
  
public Window1()
  
{
    
...
    
_processing.FingerMoved += new TouchLibEvents.TuioMoveFingerHandler(_processing_FingerMoved);
    
_processing.FingerRemoved += new TouchLibEvents.TuioRemoveFingerHandler(_processing_FingerRemoved);
    ...
  
}

  void _processing_FingerRemoved
(object senderTouchLibEvents.TuioRemoveFingerEventArgs obj)
  
{
    mTCanvas1
.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Input, (Action)delegate()
    
{
      this
.mTCanvas1.Children.Remove((UIElement)this.ellipseHash[obj.Id]);
      
this.ellipseHash.Remove(obj.Id);
    
});
  
}

  void _processing_FingerMoved
(object senderTouchLibEvents.TuioMoveFingerEventArgs obj)
  
{
    mTCanvas1
.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Input, (Action)delegate()
    
{
      
if(!ellipseHash.ContainsKey(obj.Finger.Id)) {
        Ellipse el 
= new Ellipse();
        
el.Width 20;
        
el.Height 20;
        
el.Fill null;
        
el.Stroke Brushes.Black;
        
el.StrokeThickness 3;
        
this.mTCanvas1.Children.Add(el);
        
this.ellipseHash.Add(obj.Finger.Idel);
        
MTCanvas.SetZIndex(el26);
      
}
      MTCanvas
.SetLeft((UIElement)ellipseHash[obj.Finger.Id]obj.Finger.position.SystemParameters.PrimaryScreenWidth);
      
MTCanvas.SetTop((UIElement)ellipseHash[obj.Finger.Id]obj.Finger.position.SystemParameters.PrimaryScreenHeight);
    
});
  

  
...
}

Profile
 
 
Posted: 09 June 2008 08:31 AM   [ Ignore ]   [ # 33 ]
New Member
Rank
Total Posts:  20
Joined  2008-03-19

Hi David,

I have added the code to the framework but it still doesn’t work very well. So I have decided to change the hittest code . I think I will post the new version tomorrow.
In the new version a property (showFingerPos) can be set to show ellipses on the position of the fingers.

The fingernew before the fingermove is also fixed.

Profile
 
 
Posted: 11 June 2008 09:02 AM   [ Ignore ]   [ # 34 ]
New Member
Rank
Total Posts:  20
Joined  2008-03-19

A new version is available for download. In this version the possibility to show the fingerspositions is available,the scale and rotation is improved, we have added a MTMediaElement to the controls and have fixed some bugs!

I’ll hope everyone will enjoy this new version.
it is available for download at the first post of this thread or at the google project page

Jurbo

Profile
 
 
Posted: 13 June 2008 03:57 AM   [ Ignore ]   [ # 35 ]
New Member
Rank
Total Posts:  20
Joined  2008-05-14

Hey Jurbo.

Nice work on the nwe resize and rotate code, works really good. Now i realise one more thing that isn’t working this must be because we told you that FingerMoved fired before FingerNew now fingernew fires as well as finger removed but unfortunately fingermoved is never fired. This is quite strange but i’ve tried everything but no show.. Anyway thanks for the improvements!

Keep up the good work

Profile
 
 
Posted: 13 June 2008 04:21 AM   [ Ignore ]   [ # 36 ]
New Member
Rank
Total Posts:  20
Joined  2008-03-19

Hi Calvin,

That is really strange indeed. I have tried it with the same code and it just works fine.

Does someone else have also a problem with the FingerMoved event?

Profile
 
 
Posted: 23 June 2008 03:12 AM   [ Ignore ]   [ # 37 ]
Jr. Member
Avatar
RankRank
Total Posts:  37
Joined  2008-04-27

Just wondering, is it really necessary to use VS2008 for WPF?  Coz I use VS2005 for alot of my other stuff and would not like the hassle of installing a new version of VS yet.  From the WPF examples I’ve seen on the web, there is quite a large amount of WPF driven apps done using VS2005.

 Signature 

Pissed Right Off Genetically Engineered Nerd

Profile
 
 
Posted: 23 June 2008 06:09 AM   [ Ignore ]   [ # 38 ]
New Member
Rank
Total Posts:  20
Joined  2008-03-19

I think it is working on vs2005, but i haven’t tested it. Maybe you can post the result here?
Important is that you have the .Net framework 3.5 installed on your pc.

Profile
 
 
Posted: 23 June 2008 11:59 AM   [ Ignore ]   [ # 39 ]
Elite
Avatar
RankRankRankRank
Total Posts:  275
Joined  2008-06-01

Thanks for putting this together Jurbo.
I’ve got everything downloaded and I’m ready to get to work.

 Signature 

Blobs the likes of which even the Gods have not seen!

Profile
 
 
Posted: 03 July 2008 11:19 PM   [ Ignore ]   [ # 40 ]
New Member
Avatar
Rank
Total Posts:  14
Joined  2008-05-09

Hey I got two questions for ya.....

One: How do I add support for new gestures. I can make the gestures but when the application in production tries to run it, it recognized it but then crashes....
error: (The gesture added was titled “Menu")

System.FormatException was unhandled
  Message
="Menu is not a valid value for PossibleGestures."
  
Source="System"
  
StackTrace:
       
at System.ComponentModel.EnumConverter.ConvertFrom(ITypeDescriptorContext contextCultureInfo cultureObject value)
       
at System.ComponentModel.TypeConverter.ConvertFromString(String text)
       
at Gestures.Gesture.throwGestureEvent(String gestureName)
       
at Gestures.Gesture.sendGesture()
       
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       
at System.Threading.ExecutionContext.Run(ExecutionContext executionContextContextCallback callbackObject state)
       
at System.Threading.ThreadHelper.ThreadStart()
  
InnerExceptionSystem.ArgumentException
       Message
="Requested value 'Menu' was not found."
       
Source="mscorlib"
       
StackTrace:
            
at System.Enum.Parse(Type enumTypeString valueBoolean ignoreCase)
            
at System.ComponentModel.EnumConverter.ConvertFrom(ITypeDescriptorContext contextCultureInfo cultureObject value)
       
InnerException:

Two: How can gestures trigger events?

 Signature 

My MT Gallery (more soon)

Profile
 
 
Posted: 15 August 2008 04:50 AM   [ Ignore ]   [ # 41 ]
New Member
Rank
Total Posts:  20
Joined  2008-05-14

Hey Jurbo..

One last question i got for you.. I am trying to get the area of a blob. It sends it through the OSC does your framework allow to use this??

Profile
 
 
   
3 of 3
3