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

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 ]
New Member
Rank
Total Posts:  7
Joined  2008-08-25

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 ]
Elite
RankRankRankRank
Total Posts:  304
Joined  2007-03-13

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 

my multitouch blog: http://www.whitespaced.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 ]
New Member
Rank
Total Posts:  7
Joined  2008-08-25

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 ]
New Member
Rank
Total Posts:  7
Joined  2008-08-25

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 ]
New Member
Rank
Total Posts:  7
Joined  2008-08-25

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 ]
New Member
Rank
Total Posts:  7
Joined  2008-08-25

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
 
 
   
4 of 4
4