2 of 10
2
WPF Multitouch Framework
Posted: 23 May 2008 08:12 AM   [ Ignore ]   [ # 16 ]
Avatar
RankRank
Joined  2008-01-28
Total Posts:  124
Member

very impressive Jurbo ! ......
quite responsive ......

Profile
 
 
Posted: 24 May 2008 10:55 AM   [ Ignore ]   [ # 17 ]
Rank
Joined  2008-05-14
Total Posts:  25
New Member

hey jurbo, im working on your framework with my DI table and it is awesome, i just have a few questions

the resize and rotation doesnt quote work like it should work, it seems to get confused sometomes whether im making it bigger or smaller
otherwie everything else is nice, you don’t maybe have a video playing control?? or a photo app demo which i could use to create my own..

One last thing, i am trying to open another form when a gesture is recognised but i seem to be getting a thread exception

The calling thread must be STA, because many UI components require this.

This happens when the new form initializes.. Thanks for the framework! A+

One more question, when i’m playing with a control it goes on top but as soon as i release it, then the radio buttons, checkboxes and stuff just appear on top of the image or the control? is there a property i must set so that the last object i touch remains on top?

Profile
 
 
Posted: 24 May 2008 01:16 PM   [ Ignore ]   [ # 18 ]
Rank
Joined  2008-03-19
Total Posts:  20
New Member

Hi Calvin,,

When you want to resise and rotate you have to put two fingers in the corner of the object (left at the top corner and right at the bottom corner). When you have done that the scaling and rotating will work fine.

At this moment the framework doesn’t contain a “scatterview” and a (MT)video playing control. But, you can make a video playing control by yourself. When you are using a MediaElement, you can set the source to an existing
video. This media element can be made draggable, resizable and rotatable with this code:
MTObject.TouchEnabled(yourMediaElementName, true);
MTObject.SetCanBeDragged(yourMediaElementName,true);
MTObject.SetCanBeScaled(yourMediaElementName,true);
MTObject.SetCanBeRotated(yourMediaElementName,true);
Just give it a try and you will see it works.

About the form:
When you add this to your code the problem is solved:

YourParentObject.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Input, (Action)delegate()
{
///Add your form create code here… Change YourParentObject to the object where you add the form, by example mTCanvas1
} ) ;

At this moment you can not set a property to let the control stay on top. The Z-index is changed to 10 when you are touching an object, but is changing back to its original Z value
when the last finger leaves the object. Maybe we change this in a later release.

I’ll hope this will make some things clear,,

Jurbo

Profile
 
 
Posted: 25 May 2008 03:52 AM   [ Ignore ]   [ # 19 ]
Rank
Joined  2008-05-14
Total Posts:  25
New Member

It seems like your framework is not very thread friendly.. :( What is the best way to enable multitouch on a new loaded form because i’ve got it showing now and i thought maybe by copying the _processing code from the one form and put it on the new one it should work but i’m getting an Exception has been thrown by the target of an invocation. Error message.

Would this mean i would have to close the processing on the one form and open it on the second one?? Sorry to be such a pest.

Thanking you
Calvin Muller

Profile
 
 
Posted: 25 May 2008 09:29 AM   [ Ignore ]   [ # 20 ]
RankRank
Joined  2008-05-16
Total Posts:  117
Member

Very nice Jurbo.

I know this is early in development - what plans do you have for future enhancements?

What license is used here? Can it used (not modified) in apps people create - even commercial?

Profile
 
 
Posted: 26 May 2008 02:05 AM   [ Ignore ]   [ # 21 ]
Rank
Joined  2008-03-19
Total Posts:  20
New Member
Calvin Muller - 25 May 2008 03:52 AM

It seems like your framework is not very thread friendly.. :( What is the best way to enable multitouch on a new loaded form because i’ve got it showing now and i thought maybe by copying the _processing code from the one form and put it on the new one it should work but i’m getting an Exception has been thrown by the target of an invocation. Error message.

Would this mean i would have to close the processing on the one form and open it on the second one?? Sorry to be such a pest.

Thanking you
Calvin Muller

Correct me if I am wrong, but in WPF you always have to invoke the graphics thread when you are going to change layout stuff, so this has nothing to do with our framework.

Can you post your form creation code here? Maybe I can fix the error you get. We haven’t tested it with more than one form so this can help us to make a better framework.

Profile
 
 
Posted: 26 May 2008 03:06 AM   [ Ignore ]   [ # 22 ]
Rank
Joined  2008-05-14
Total Posts:  25
New Member

I’m very new to WPF so i can’t speak.. hahaha.. I’m used to normal Windows Forms and it seems to be waay different, i didn’t mean what i said in a criticising way.. i will post my code below..

This is when the button on the one form is clicked..

private void mTButton3_Click(object senderRoutedEventArgs e)
        
{
            _processing
.WriteToDebug("button 3 clicked!");
            
mTCanvas1.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Input, (Action)delegate()
            
{
                _processing
.Disconnect();
                
= new MultitouchApplication.Paint();
                
w.Show();        
            
});
        
}

This is the initialization of the new form loaded..

{
            InitializeComponent
();
             
_processing = new MTProcessing(mTCanvas1);
          
//  _processing.DebugEnabled = true;
            
_processing.SimulationEnabled true;
        
}

This is the error i receive… It occurs as soon as i put my finger down on the new window..

Exception has been thrown by the target of an invocation, So it doesn’t really give a descriptive error probably because it’s on a new thread.

It seems as i have solved the problem.. The reason was because i didnt remove the standard grid… smile Thanks again..

Thanks

Profile
 
 
Posted: 27 May 2008 04:45 AM   [ Ignore ]   [ # 23 ]
Rank
Joined  2008-03-19
Total Posts:  20
New Member

Yes, that is indeed the problem. I will change this in the framework and post a new version.

Does it all work properly now?

Profile
 
 
Posted: 27 May 2008 05:47 AM   [ Ignore ]   [ # 24 ]
Rank
Joined  2008-05-14
Total Posts:  25
New Member

Yes it works cool now… Managed to sort it out..

When i show another form i call _processing.Disconnect() then window.ShowDialog() then when i close the dialog i call
_processing = new MTProcessing(mTCanvas1);
and it all seems to work well..

I have one question, when you say that a control canbeclicked = true.. How do i capture that event for that item clicked?

Say now it’s a MTImage or a MediaElement, when i set canbeclicked to true is there some sort of event i can use to see what was clicked??

thanks

Profile
 
 
Posted: 28 May 2008 02:06 AM   [ Ignore ]   [ # 25 ]
Rank
Joined  2008-03-19
Total Posts:  20
New Member

Only the button has a click event so this property is only useful for the button. When you set canbeclicked to false on a button,
no clickevent will be thrown.

As replacement you can use the leftbuttondown or the leftbuttonup event…

Profile
 
 
Posted: 05 June 2008 04:34 AM   [ Ignore ]   [ # 26 ]
Rank
Joined  2008-06-02
Total Posts:  6
New Member

Hi Guys,
does the framework show the fingerpositions as ellipses now?
If you want to avoid a UIElement to be hit-tested, just set the “IsHitTestVisible” property to false.

Ellipse e1 = new Ellipse();
e1.IsHitTestVisible = false;

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

The framework does not show fingerpositions at this moment..
We have also tried to set the IsHitTestVisible to false but the VisualTreeHelper.HitTest does not
care about this property, so the object touched is always the result of the hitTest.

it seems like the isHitTestVisible property isn’t working....

Profile
 
 
Posted: 05 June 2008 05:18 AM   [ Ignore ]   [ # 28 ]
Rank
Joined  2008-03-19
Total Posts:  20
New Member

Tomorrow or at the beginning of the next week I will post a new version of the framework!
It includes a whole new rotate and scale method, much better than the old one.
We have added some new controls and have fixed some bugs.

We also have made a new demonstration video where you can see us how we work with the framework on the table.

Today and tomorrow I wil do some last test. When it’s done I wil post it here!

Profile
 
 
Posted: 05 June 2008 11:03 AM   [ Ignore ]   [ # 29 ]
Rank
Joined  2008-05-14
Total Posts:  25
New Member

awesome stuff Jurbo! looking forward to it

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

A realtime demonstration video is available now!

Profile
 
 
   
2 of 10
2