4 of 4
4
.NET multitouch framework
Posted: 10 June 2008 03:14 AM   [ Ignore ]   [ # 46 ]
Rank
Joined  2008-06-02
Total Posts:  6
New Member

I did a svn-checkout yesterday, too. Very clean and well commented code! Your coding-style reminds me of java.  grin I switched from java to c# some months ago.

You derive all the touchable controls from WPF-controls. But with attached events and attached properties you can allow arbitrary UIElements to raise touch related routed events, without the need to derive from a class.

@MSDN: “An attached event allows you to attach a handler for a particular event to some child element rather than to the parent that actually defines the event, even though neither the object potentially raising the event nor the destination handling instance define or otherwise “own” that event in their namespace.”

I found a blog article that describes in detail how to implement custom attached events yesterday. 
SerialSeb: Attached Events By Example

Daniel D also leverages attached events in his MultiTouchVista in Multitouch.Framework.WPF.Input.MultitouchScreen

Profile
 
 
Posted: 25 August 2008 11:26 AM   [ Ignore ]   [ # 47 ]
Rank
Joined  2008-08-25
Total Posts:  7
New Member

I am not at all experienced with programming, so I would really like to use this program as a collage making program for my current project. The program looks great, but I have some questions to make it more useful for me:

- where in the code can I include my own pictures and their size/location?
- where in the code do you import the motion tracking results? I will use a different motion tracking system, which will provide me with a x, y and z coordinates of two separate sources. My motion tracking code will be writen in C++, so I would like to use a dll of this program.
- where in the code can I include a button with my own function, like a ‘change background color’ or ‘save’ button with the following code:

private void btnSave_Click(object sender, EventArgs e)
{
int width, height;

width = Collage.Width;

height = Collage.Height;

Bitmap sBit;

Rectangle screenRegiion = Screen.AllScreens[0].Bounds;

sBit = new Bitmap(width, height, PixelFormat.Format32bppArgb);

Graphics sGraph = Graphics.FromImage(sBit);

// Set the location of the rectangle area to save: first two arguments after the ( - in this case the upper left corner of the screen
sGraph.CopyFromScreen(0, 0, 0, 0, screenRegiion.Size);

//..this.Collage.Image = ImagesOnTopOfPictureBoxCollage();
//..Bitmap bmp = new Bitmap(Collage.Image);
sBit.Save("c:\\collage.jpg");
sBit.Dispose();
}

I hope you can help!

Profile
 
 
Posted: 25 August 2008 06:41 PM   [ Ignore ]   [ # 48 ]
Avatar
RankRankRank
Joined  2007-03-13
Total Posts:  371
Sr. Member

Hi Ellemieke,

I received you email but I see you posted here as well. I haven’t worked on this is quite some time. However my suggestion would be to take a look at the other .NET frameworks in this forum. They are far more complete and have a wider range of functionality that mine at the moment! If you really want to use this one, let my know than I’ll write up some tutorials for you to use!

 Signature 

the all new Multitouch South Africa http://www.multitouchsa.co.za
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 26 August 2008 02:08 AM   [ Ignore ]   [ # 49 ]
Rank
Joined  2008-08-25
Total Posts:  7
New Member

Hello Donovan,

Thank you for your reply. Could you maybe advice which .NET framework to use, because I can not get a clear view of what is out there and useful for me.
Your framework does seem to have all the main functionalities I need (collage making; rotate, scale and move images, save the result as jpg (or another image type), other collage making funtions (import images while running the program, cut parts from images, etc) would be nice, but those are not neccesairy for my current test.

Thanks,

Ellemieke

Profile
 
 
Posted: 26 August 2008 05:14 AM   [ Ignore ]   [ # 50 ]
Rank
Joined  2008-08-25
Total Posts:  7
New Member

Hi Donovan,

I found out where to change the user interface and include more pictures and buttons (in PhotoApp.xaml)
Now I have to find out whether I can rotate, scale and drag all the images using multi-touch. So the code has to communicate with our motion tracking system, which I am hopefully going to try later today. Is the motion tracking functionality worked out completely in this framework?

Profile
 
 
Posted: 26 August 2008 05:15 AM   [ Ignore ]   [ # 51 ]
Rank
Joined  2008-08-25
Total Posts:  7
New Member

I ment the rotate, scale and drag with multi-touch, not the motion tracking. Is the code for rotating, scaling and dragging worked out completely?

Profile
 
 
Posted: 26 August 2008 11:16 AM   [ Ignore ]   [ # 52 ]
Rank
Joined  2008-08-25
Total Posts:  7
New Member

I am sorry for the many posts at a row…

I just discussed the programming with someone at our faculty, who will arranged the motion tracking of our set-up. According to him, I need to replace the Touchframework.cs by something else, to make it compatible with the system used. The system will send the x, y and z coordinates of the tracked fingers through an UDP port, so I need a UDP-port reader, which opens the port and reads the coordinates. If the z coordinate is within a certain range, it will be like ‘fingerDown’, if the z coordinates go without this range, it will be like ‘fingerUp’. I can not use a motion tracking system with a webcam, since it needs to run on a holographic display.

So I need to fill in the data from the UDP port. I should not use the CsTI library, probably. How can I get this data and use it, which code is needed instead of the code in the TouchFramework.cs? Are there other parts which need to be replaced as well? I do not understand the code written in the TouchFramework.cs, so do not know how to replace it. I for instance do not understand what the CsTI cs = CsTI.Instance(); does.

I understand it will be a lot of work for you to explain this to me, to help me write the code. But I really need to get this done, since the multi-touch interface is an important part of my user-testing of the design studio. Difficult, with only three weeks programming experience…

I hope you can help?

Profile
 
 
Posted: 13 September 2008 07:22 PM   [ Ignore ]   [ # 53 ]
RankRank
Joined  2008-08-10
Total Posts:  181
Jr. Member

is the download going to be back soon?
I checked your blog but it says download is not available.
thanks!

Profile
 
 
Posted: 19 September 2008 09:41 AM   [ Ignore ]   [ # 54 ]
Rank
Joined  2008-09-17
Total Posts:  3
New Member

Ellemieke

If you look in TouchFramework.cs you’ll see in the constructor it creates an instance of CsTI and attaches handlers to 3 events, fingerUp, fingerDown and fingerUpdate. It then implements those same events and all the controls attach to it. Rewrite TouchFramework so that it listens to your UDP socket in order to trigger the events, you’ll find lots of examples on google for “c# sockets”

I’d recommend finding a more experienced developer who can help you.

Profile
 
 
Posted: 19 September 2008 09:46 AM   [ Ignore ]   [ # 55 ]
Rank
Joined  2008-08-25
Total Posts:  7
New Member

Tshannon,

Thank you for your reply. I’ll discuss it with some guys who are trying to help me.

Profile
 
 
Posted: 21 January 2009 04:44 AM   [ Ignore ]   [ # 56 ]
Rank
Joined  2008-01-30
Total Posts:  29
New Member

where is the most recent version of the code?

also does anyone know how i can create my own classes (like touchImage) and add them to the app? I’d like to have a control like MTCanvas in the other frameworks??

I don’t want to use the other frameworks because from what i can see they don’t give you access to the scale/rotate functions and in my project i need to perform functions (such as restrict size) of an object when it is scaled.

EDIT: Solved it now - just changed the properties of a canvas!

Profile
 
 
   
4 of 4
4