Dual-Touch SDK for Resistive Screens V1.0 Beta, Rotation Alpha
| 22,705 views | Print This Post
|
In December last year, i posted an Alpha version of this SDK. Now it is mature enough to announce it as Beta. This SDK allows developers to build Dual-Touch enabled applications. so let’s get into action.
Features:
- Pinch to Zoom Support
- Drag (swipe) support.
- Replacement events for the mouse move fires only when a single finger detected.
- Multiple events based on gestures.
- Performance optimized, memory footprint is minimal.
To use this SDK you will need Visual Studio Professional or better. start a new Smart Device Project, and add the SDK to your references.
The SDK is consists of only one object, which is DualTouchSDK. We will need one instance of this class for every control that supports pinch to zoom or drag in your application.
There are several methods, properties and events that can be utilized in order to achieve multitouch effect. i have done my best to make this as easy as possible, my code is now complex but it is necessary to achieve easy implementation.
Methods
public void MouseUp()
This method MUST be called when the original MouseUp event of the control that supports multitouch.
public void SetMouseDown(int x, int y)
Whenever your control fires the MouseDown even you must call this even along with the X and Y coordinates that are given to you by the MouseEventArgs. It provides the SDK with the information required.
public void SetMouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
As usual, this Method is used so the SDK will get to determine when a Dual Touch is performed. Pass the MouseEventArgs as provided by the MouseMove event from your control.
Events
public event DualTouchSDK.DualTouchSDK.MultiTouchEventHandler Zooming
Whenever you have hooked the SDK to the events of your control, this even will be fired when a pinchtozoom is happening, it will keep firing as the user tries to zoom in or out until both fingers are off the screen.
The event provides an object of type MultiTouchEventArgument, it will give your application the indication of the zoom status as follows :
Point e.FirstPoint, returns the point which the first finger is located in (basically the First Touch to the screen)
point e.SecondPoint, contains the 2nd point X and Y coordinates.
double e.ZoomRatio, it will simply return a double number which indicates the percentage of the zoom, the value is always greater than Zero (0), to know if you are zooming in or out you can simply detect the value of it. When the value is Less than ONE (1) then the user is pinching OUT, for example if you got the value of 0.65 this means that the user has zoomed out to a total size of 65% of the original size.
same applies for the Zoom IN but in this case you get a number that is greater than ONE, for example if you got the Ratio of 1.40, it indicates that the user is zooming IN by 40%.
public event System.Windows.Forms.MouseEventHandler MouseMoved
When working with dualtouch, your MouseMove event of your control will NOT distinguish between the single finger and dual finger mouse move, this event can be used to get the SINGLE finger mouse move event.
public event DualTouchSDK.DualTouchSDK.DragEventHandler Dragged
When this event is triggered, it indicates that the user has dragged your control into a direction, the direction is determined by evaluating the value of the object (DualTouchSDK.dragDirection e).
the dragDirection object contains FOUR (4) important bool properties,
e.up;
e.down;
e.left;
e.right
Each one can get a status of true or false depending if the drag is going in that direction or not. for example if the user swipes his finger from the center toward the top of the screen, the return value will be UP = TRUE only. Notice that the SDK supports diagonal Dragging so you can get a combination of 8 Directions.
Properties
public int DragLengthToDetect { set; get; }
This property is used to give the developer the option to decide the minimum drag length (in pixels) that is required to trigger the Dragged Event. If the user Drags more or equal to this value, the event would be fired. Otherwise the operation will be ignored.
the default value for this property is 100 pixels.
public int DragLengthToDetect { set; get; }
This property sets the minimum distance between 2 fingers to detect a dualtouch, if the fingers have an original distance less than this value it will be ignored and treated as a single touch.
The default value of this property is 50 pixels.
Notice: This SDK is provided as is, without any guarantee or support.
You are not allowed to reverse engineer this SDK or any Executable, Assembly, DLL or file of any format.
You CAN use this SDK free of charge as long as:
1) You downloaded it from here.
2) Your application is provided free of charge.
3) You mention the usage of this SDK on your application and website with a link to this page.
4) If you have a commercial application and want to use this SDK, I must be contacted and an electronic/written approval must be obtained from me directly, notice that you must still download it from here and mention this post in the application and site. you may contact me through the Contact for found on top of the page or email me directly on adel [@at] windowsphoneme.com
(note : you have to be registered and logged in to download)
Download the SDK With Rotation Alpha from here
Download the Rotate To Exit Sample Application from here
Rotate To Exit Video
The implementation of the rotation is the same, you will get the rotation event wich gives the degrees of rotation in degrees Max 180 degrees. Let’s see a rotate to lock application
15 Comments for this entry
43 Trackbacks / Pingbacks for this entry
-
Developers : MultiTouch SDK for Resistive Screens 1.0 Beta | windows mobile software, wm6.5 games and wm7 news
April 19th, 2010 on 4:39 am[...] info : windowsphoneme.com SPONSOR var pubId=24035; var siteId=24036; var kadId=18552; var kadwidth=336; var kadheight=280; [...]
-
-
Multi-Touch / Dual-Touch SDK for Resistive touchscreens released « MobileTechWorld
April 19th, 2010 on 3:24 pm[...] can grab the SDK here, and follow the discussion thread [...]
-
Rezistif Ekranda Multi-Touch | PocketPC.gen.tr
April 19th, 2010 on 5:46 pm[...] çalışma mantığı ile ilgili yazıya buradan [...]
-
Multitouch SDK dla ekranów oporowych | :: mobione :: multiblog o technologiach mobilnych
April 19th, 2010 on 8:37 pm[...] implementacje multitouch na urządzeniach z ekranem oporowym. Właśnie została wydana wersja 1.0 Beta. W SDK zaimplementowane są podstawowe gesty obsługiwane dwoma palcami, takie jak Pinch to Zoom. [...]




(19 votes, average: 4.53 out of 5)











April 20th, 2010 on 7:41 am
were is the cab
April 20th, 2010 on 12:37 pm
great job man.. i salute
April 20th, 2010 on 1:19 pm
@Leonardo Soriano III
There is no cab, this is not an application. it is a software development KIT so the developers will benifit from this. You have to wait until someone utilizes the SDK in their application
@amgadpasha
Thanks for your support.
April 21st, 2010 on 4:11 am
Hope you can also release a sample source code on how to use it, thanks you’re great!
April 21st, 2010 on 11:48 am
The Sample application has the Source Code.