SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
APPLICATION DEVELOPMENT WITH
   TOUCH AND SENSORS ON
  ULTRABOOKTM / WINDOWS 8

         Sulamita Garcia – sulamita.garcia@intel.com
                Technical Marketing Engineer
                    Twitter @sulagarcia



                           Copyright© 2012, Intel Corporation. All rights reserved.
                     *Other brands and names are the property of their respective owners
                                                                                           1
/me
MAHJONG DEMO HERE




         Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners
                                                                                                                                        3
Using touch in a desktop application
• Touch and gestures
   –   Tap/Double tap                                                                              –             Zoom
   –   Panning with inertia                                                                        –             Rotate
   –   Selection/Drag                                                                              –             Two-finger tap
   –   Press and tap                                                                               –             Flicks
   –   Press and hold
• Do’s and Don’t of gesture interfaces
• Demo: Use touch and gestures to select, move and
  manipulate three images
• The Windows Touch API
• Using touch with XMAL

                      Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                     4
Adding touch to a desktop application
•    Touch is not a mouse
•    Make touch targets large enough
•    Support standard gestures and behaviors
•    Portrait vs. Landscape
•    Do not use touch just for touch’s sake
•    Touch should be forgiving
•    Microsoft User Experience Guidelines
     – msdn.microsoft.com/en-
       us/library/windows/desktop/cc872774.aspx
     – blogs.msdn.com/b/ie/archive/2012/04/20/guidelines-for-
       building-touch-friendly-sites.aspx

                     Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                    5
Designing for Touch User Experience
• Design UI to include traditional laptop style and tablet
  mode usages
• Space and size controls to register fuzzy touch input
        – Common Controls: 23X23 pixels
        – Command Controls: 40X40 pixels
• Use multiple form tabs for touch efficiency
• Consider the target size while designing your
  application UI
• Use natural and intuitive controls
• Ultrabook Optimal Resolution: 1366X768
Source: MSDN
http://msdn.microsoft.com/en-us/library/windows/desktop/cc872774.aspx#guidelines




                                                              Copyright(C) 2012 Intel Corporation. All rights reserved.
                                                         *Other brands and names are properties of their respective owners.
                                                                                                                              6
Designing for Touch User Experience
• Use common controls as much as possible
• Choose custom controls that support touch
• Prefer constrained controls to unconstrained
  controls
• Provide default values and auto text-
  completion
• Use check boxes instead of multiple selection
  lists
Source: MSDN
http://msdn.microsoft.com/en-us/library/windows/desktop/cc872774.aspx#guidelines



                                                         Copyright(C) 2012 Intel Corporation. All rights reserved.
                                                    *Other brands and names are properties of their respective owners.
                                                                                                                         7
Designing for Touch User Experience
• Place controls in areas better utilized for touch
• Command controls should be more easily
  accessible




                         Copyright(C) 2012 Intel Corporation. All rights reserved.
                    *Other brands and names are properties of their respective owners.
                                                                                         8
Using Windows Touch API
• Touch and gesture events are delivered via Windows
  Touch messages
   – Windows must register for Windows Touch input
• WM_TOUCH reports action, position and identifier
• WM_GESTURE describes the gesture via GESTUREINFO
  structure
• Special interfaces to help process gesture messages
   – IManipulationProcessor
   – IInertiaProcessor
• API reference at msdn.microsoft.com/en-
  us/library/windows/desktop/dd371406%28v=vs.85%2
  9.aspx




                          Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                         9
Sensors and Windows Native
• Sensor manager controls sensors
  – Use sensor manager to get to sensors
  – Notifies when a sensor connects
• Sensors report data, changes in state and
  disconnection
• Access both via COM interfaces
  – Use API to communicate to sensors
  – Sensor events handled using callbacks
  – API reference at msdn.microsoft.com/en-
    us/library/windows/desktop/dd318953%28v=vs.85%2
    9.aspx

                 Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                10
WinNative: Receive gesture message
                                                                                    LRESULT CALLBACK
                                                                                        WndProc(…)
                                                                                    {
                                                                                      …
                                                                                      switch (message)
                                                                                      {
• Check for                                                                             case WM_GESTURE:
                                                                                          // Call code to
  WM_GESTURE message                                                                      // interpret the
  in WndProc                                                                              // gesture
                                                                                          return
                                                                                            DecodeGesture(…);
                                                                                        …
                                                                                    }

                                                                                                                                             (Source: Microsoft)


              Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                            11
WinNative: Process gesture
                                                                                        LRESULT DecodeGesture(…)
                                                                                        {
• Retrieve the additional                                                                 …
                                                                                          BOOL bResult = GetGestureInfo(…);
  gesture information from                                                                      BOOL bHandled = FALSE;
  the GESTUREINFO                                                                               if (bResult)
  structure                                                                                     {
                                                                                                  // now interpret the gesture
                                                                                                  switch (gi.dwID){
                                                                                                    case GID_ZOOM :
                                                                                                      // Code for zooming goes here
                                                                                                      bHandled = TRUE;
• Handle each of the                                                                                  break;
                                                                                                    case GID_PAN :
  possible gestures                                                                                   …
                                                                                                    case GID_ROTATE :
                                                                                                      …
                                                                                                    case GID_TWOFINGERTAP:
                                                                                                      …
                                                                                                    case GID_PRESSANDTAP:
                                                                                                      …
                                                                                                    default:
                                                                                                     // A gesture was not recognized
                                                                                                     break;
                                                                                                  }     …                      (Source: Microsoft)

                  Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                 12
Demo
• New Windows*8 UI
  application
  – Full screen
  – Borderless window
• Desktop application
  – Runs in desktop
    environment                                                                                                                                Source: Microsoft



  – Multiple windows
  – Can support touch and sensors

                Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners
                                                                                                                                                              13
Using touch and XAML/.NET
• XAML provides access to WPF touch-enabled
  UI components
  – WPF touchs event are available in both Windows* 7 and
    Windows* 8.
• Typical gesture events:
  – ManipulationStarting
  – ManipulationDelta
  – ManipulationInertiaStarting



                   Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                  14
XAML: TouchControl.xaml
                                                                        <UserControl x:Class="Win8Demo.TouchControl"
• Three images placed in                                                    …>

  a Grid inside of a                                                        <Grid x:Name="cont" ClipToBounds="True" >
                                                                                <!-- Set the IsManipulationEnabled to

  TouchControl                                                                   true -->
                                                                                <Image x:Name="photo_1"
                                                                                  Source="/Assets/ultrabook1.png“
                                                                                  IsManipulationEnabled="True"
                                                                                  Width="500" />

• Each image has                                                                <Image x:Name="photo_2“
                                                                                  Source="/Assets/ultrabook2.png“

  IsManipulationEnabled                                                           IsManipulationEnabled="True“
                                                                                  Width="500" Margin="125,-79,25,79"/>
                                                                                <Image x:Name="photo_3“
  set to true                                                                     Source="/Assets/ultrabook3.png“
                                                                                  IsManipulationEnabled="True“
                                                                                  Width="500" Margin="0,-59,150,59" />
                                                                            </Grid>
                                                                        </UserControl>




                 Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                15
Touch Event State Diagram
                               Events begin with User
Manipulation                   Touching the Image
  Starting

                                                                                         Manipulation
                   Manipulation
                                                                                            Delta
Manipulation      Inertia Starting
                                                                                          w/ Inertia
   Delta
                               User finger is lifted from the
                                          screen
 User finger is
 touching the
    screen                                                                               Manipulation
                                                                                          Completed
                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners
                                                                                                        16
XAML: TouchControl.xaml.cs
                                                                                 public TouchControl()
                                                                                 {
                                                                                    …

                                                                                              //Register for manipulation events

• Add event handlers to                                                                       photo_1.ManipulationStarting +=
                                                                                                 m_rect_ManipulationStarting;
                                                                                              photo_1.ManipulationDelta +=
  each image for:                                                                                m_rect_ManipulationDelta;
                                                                                              photo_1.ManipulationInertiaStarting +=
  •ManipulationStarting                                                                          m_rect_ManipulationInertiaStarting;

  •ManipulationDelta                                                                          photo_2.ManipulationStarting += …
  •ManipulationInertiaStarting                                                                photo_3.ManipulationStarting += …
                                                                                 }




                      Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                     17
Touch Event State Diagram
                               Events begin with User
Manipulation                   Touching the Image
  Starting

                                                                                         Manipulation
                   Manipulation
                                                                                            Delta
Manipulation      Inertia Starting
                                                                                          w/ Inertia
   Delta
                               User finger is lifted from the
                                          screen
 User finger is
 touching the
    screen                                                                               Manipulation
                                                                                          Completed
                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners
                                                                                                        18
XAML: Manipulation starting event
              handler
• ManipulationStarting event                                                                 void
  handler is called at start of                                                              m_rect_ManipulationStarting
  touch event                                                                                (…)
                                                                                             {
                                                                                               …
• By setting Manipulation-                                                                     e.ManipulationContainer =
  Container to the touched                                                                      this;
  image all subsequent
  manipulation events will be                                                                }
  relative to that element




                       Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                      19
Touch Event State Diagram
                               Events begin with User
Manipulation                   Touching the Image
  Starting

                                                                                         Manipulation
                   Manipulation
                                                                                            Delta
Manipulation      Inertia Starting
                                                                                          w/ Inertia
   Delta
                               User finger is lifted from the
                                          screen
 User finger is
 touching the
    screen                                                                               Manipulation
                                                                                          Completed
                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners
                                                                                                        20
XAML: Manipulation delta event
               handler
• ManipulationDelta                                          void m_rect_ManipulationDelta(…)
                                                             {
  event happens as user                                        …
                                                               //Get the manipulation’s delta
  moves fingers                                                var delta = e.DeltaManipulation;

                                                                      //Compute the transformed center point
                                                                      Point rectCenter = new Point(rect.ActualWidth *
                                                                        0.5, rect.ActualHeight * 0.5);
• Compute new image                                                   rectCenter = matrix.Transform(rectCenter);

  center point, scale, and                                            //Adjust the element’s scale, rotation and
                                                                        translation
  rotation using event                                                matrix.ScaleAt(delta.Scale.X, delta.Scale.Y,
                                                                        rectCenter.X, rectCenter.Y);
  data                                                                matrix.RotateAt(delta.Rotation, rectCenter.X,
                                                                        rectCenter.Y);
                                                                      matrix.Translate(delta.Translation.X,
                                                                        delta.Translation.Y);

• Set Handled to true so                                              //Update the element’s render transformation
                                                                      rect.RenderTransform =
  other handlers don’t                                                  new MatrixTransform(matrix);
  process same event                                                  e.Handled = true;


                     Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                    21
Touch Event State Diagram
                               Events begin with User
Manipulation                   Touching the Image
  Starting

                                                                                         Manipulation
                   Manipulation
                                                                                            Delta
Manipulation      Inertia Starting
                                                                                          w/ Inertia
   Delta
                               User finger is lifted from the
                                          screen
 User finger is
 touching the
    screen                                                                               Manipulation
                                                                                          Completed
                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners
                                                                                                        22
XAML: Inertia starting event handler
•   Inertia actions are handled by the                                                   void m_rect_ManipulationInertiaStarting(…)
                                                                                         {
    ManipulationInertiaStarting event                                                      //Set the manipulations inertia values
    handler                                                                                e.TranslationBehavior = new
                                                                                             InertiaTranslationBehavior()
•   Define the behavior of the inertia                                                       {
    by specifying                                                                               InitialVelocity =
                                                                                                e.InitialVelocities.LinearVelocity,
     • Linear velocity                                                                          DesiredDeceleration =…
     • Deceleration                                                                          };
     • Expansion velocity (used in                                                         e.ExpansionBehavior = new
                                                                                             InertiaExpansionBehavior()
         pinch or spread)                                                                    {
     • Angular velocity (used in                                                                InitialVelocity =
                                                                                                e.InitialVelocities.ExpansionVelocity,
         rotation)                                                                              DesiredDeceleration = …
                                                                                             };
                                                                                           e.RotationBehavior = new
                                                                                             InertiaRotationBehavior()
                                                                                             {
                                                                                                InitialVelocity =
•   Again, set Handled to true so other                                                         e.InitialVelocities.AngularVelocity,
                                                                                                DesiredDeceleration = …
    handlers don’t process same event                                                        };
                                                                                           e.Handled = true;…

                           Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                          23
Touch Event State Diagram
                               Events begin with User
Manipulation                   Touching the Image
  Starting

                                                                                         Manipulation
                   Manipulation
                                                                                            Delta
Manipulation      Inertia Starting
                                                                                          w/ Inertia
   Delta
                               User finger is lifted from the
                                          screen
 User finger is
 touching the
    screen                                                                               Manipulation
                                                                                          Completed
                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners
                                                                                                        24
XAML: Handle inertia manipulation
                                                                                               if (e.IsInertial)
• Check if inertia is moving the                                                                {
  image across the grid                                                                           //Get the containing element’s size
                                                                                                  Rect containingRect = …
                                                                                                     (e.ManipulationContainer).RenderSize);
                                                                                                  //Get the transformed element’s new
                                                                                                  //bounds
                                                                                                  Rect shapeBounds =
                                                                                                     rect.RenderTransform.TransformBounds
                                                                                                     (…);
                                                                                                  //If element falls out of bounds
• If so, make sure image does not                                                                 if
                                                                                                  (!containingRect.Contains(shapeBounds))
  travel outside of the grid by                                                                   {
                                                                                                     //Report boundary feedback
  calling the Complete method to                                                                     e.ReportBoundaryFeedback(…);
  end the inertia                                                                                    //Stop any after inertia
                                                                                                     e.Complete();
                                                                                                  }
                                                                                                }
                                                                                         …




                         Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                        25
References
• Intel Ultrabook™ Community
• Intel® Software Network
  – software.intel.com
• Windows Development Reference
  – msdn.microsoft.com/en-
    us/library/windows/desktop/hh447209%28v=vs.85%2
    9.aspx
• WinRT API Reference
  – msdn.microsoft.com/en-
    us/library/windows/apps/br211377.aspx

                 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners
                                                                                                                                                26
Q&A


Sulamita Garcia – sulamita.garcia@intel.com
       Technical Marketing Engineer
           Twitter @sulagarcia




            Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners
                                                                                                                                           27

Contenu connexe

Tendances

Deploying Intel Architecture-based Tablets with Windows* 8 at Intel
Deploying Intel Architecture-based Tablets with Windows* 8 at IntelDeploying Intel Architecture-based Tablets with Windows* 8 at Intel
Deploying Intel Architecture-based Tablets with Windows* 8 at IntelIT@Intel
 
Android application development
Android application developmentAndroid application development
Android application developmentFahad A. Shaikh
 
Kl ftf channel desktop roadmap final
Kl ftf channel desktop roadmap finalKl ftf channel desktop roadmap final
Kl ftf channel desktop roadmap finalAju Poduval
 
UX: Raising the bar with Software Development by Sulamita Garcia from Intel
UX: Raising the bar with Software Development by Sulamita Garcia from IntelUX: Raising the bar with Software Development by Sulamita Garcia from Intel
UX: Raising the bar with Software Development by Sulamita Garcia from IntelBeMyApp
 
Windows 8 hardware sensors
Windows 8 hardware sensorsWindows 8 hardware sensors
Windows 8 hardware sensorsMatteo Pagani
 
Intel Real Sense, Diversity Meetup by Jamie Tanna
Intel Real Sense, Diversity Meetup by Jamie TannaIntel Real Sense, Diversity Meetup by Jamie Tanna
Intel Real Sense, Diversity Meetup by Jamie TannaBeMyApp
 
IT@Intel: Creating Smart Spaces with All-in-Ones
IT@Intel:  Creating Smart Spaces with All-in-OnesIT@Intel:  Creating Smart Spaces with All-in-Ones
IT@Intel: Creating Smart Spaces with All-in-OnesIT@Intel
 
Meego Italian Day 2011 – Andrea Grandi
Meego Italian Day 2011 – Andrea GrandiMeego Italian Day 2011 – Andrea Grandi
Meego Italian Day 2011 – Andrea GrandiFrancesco Baldassarri
 
Compound Versus Elemental Devices New Mobile Device Market Strategies 6.1...
Compound Versus Elemental Devices   New Mobile Device Market Strategies   6.1...Compound Versus Elemental Devices   New Mobile Device Market Strategies   6.1...
Compound Versus Elemental Devices New Mobile Device Market Strategies 6.1...www.webhub.mobi by Yuvee, Inc.
 
The changing computer for small biz
The changing computer for small bizThe changing computer for small biz
The changing computer for small bizRamon Ray
 
A Glimpse On MeeGo
A Glimpse On MeeGoA Glimpse On MeeGo
A Glimpse On MeeGoAmanda Lam
 
Extending softwareintomobile 11 28-2012
Extending softwareintomobile 11 28-2012Extending softwareintomobile 11 28-2012
Extending softwareintomobile 11 28-2012CorSource
 

Tendances (20)

Intel AppUp Webinar Italiano General Information
Intel AppUp Webinar Italiano General InformationIntel AppUp Webinar Italiano General Information
Intel AppUp Webinar Italiano General Information
 
MeeGo Overview DeveloperDay Munich
MeeGo Overview DeveloperDay MunichMeeGo Overview DeveloperDay Munich
MeeGo Overview DeveloperDay Munich
 
Intel AppUp™ SDK Suite 1.2 for MeeGo
Intel AppUp™ SDK Suite 1.2 for MeeGoIntel AppUp™ SDK Suite 1.2 for MeeGo
Intel AppUp™ SDK Suite 1.2 for MeeGo
 
Writing applications for multiple stores on the WeTab
Writing applications for multiple stores on the WeTabWriting applications for multiple stores on the WeTab
Writing applications for multiple stores on the WeTab
 
Deploying Intel Architecture-based Tablets with Windows* 8 at Intel
Deploying Intel Architecture-based Tablets with Windows* 8 at IntelDeploying Intel Architecture-based Tablets with Windows* 8 at Intel
Deploying Intel Architecture-based Tablets with Windows* 8 at Intel
 
Android application development
Android application developmentAndroid application development
Android application development
 
Kl ftf channel desktop roadmap final
Kl ftf channel desktop roadmap finalKl ftf channel desktop roadmap final
Kl ftf channel desktop roadmap final
 
UX: Raising the bar with Software Development by Sulamita Garcia from Intel
UX: Raising the bar with Software Development by Sulamita Garcia from IntelUX: Raising the bar with Software Development by Sulamita Garcia from Intel
UX: Raising the bar with Software Development by Sulamita Garcia from Intel
 
Windows 8 hardware sensors
Windows 8 hardware sensorsWindows 8 hardware sensors
Windows 8 hardware sensors
 
MeeGo AppLab Desktop Summit 2011 - AppUp
MeeGo AppLab Desktop Summit 2011 - AppUpMeeGo AppLab Desktop Summit 2011 - AppUp
MeeGo AppLab Desktop Summit 2011 - AppUp
 
Intel Real Sense, Diversity Meetup by Jamie Tanna
Intel Real Sense, Diversity Meetup by Jamie TannaIntel Real Sense, Diversity Meetup by Jamie Tanna
Intel Real Sense, Diversity Meetup by Jamie Tanna
 
IT@Intel: Creating Smart Spaces with All-in-Ones
IT@Intel:  Creating Smart Spaces with All-in-OnesIT@Intel:  Creating Smart Spaces with All-in-Ones
IT@Intel: Creating Smart Spaces with All-in-Ones
 
Chapter 05
Chapter 05Chapter 05
Chapter 05
 
Meego Italian Day 2011 – Andrea Grandi
Meego Italian Day 2011 – Andrea GrandiMeego Italian Day 2011 – Andrea Grandi
Meego Italian Day 2011 – Andrea Grandi
 
Compound Versus Elemental Devices New Mobile Device Market Strategies 6.1...
Compound Versus Elemental Devices   New Mobile Device Market Strategies   6.1...Compound Versus Elemental Devices   New Mobile Device Market Strategies   6.1...
Compound Versus Elemental Devices New Mobile Device Market Strategies 6.1...
 
The changing computer for small biz
The changing computer for small bizThe changing computer for small biz
The changing computer for small biz
 
Windows phone
Windows phoneWindows phone
Windows phone
 
A Glimpse On MeeGo
A Glimpse On MeeGoA Glimpse On MeeGo
A Glimpse On MeeGo
 
Sikuli
SikuliSikuli
Sikuli
 
Extending softwareintomobile 11 28-2012
Extending softwareintomobile 11 28-2012Extending softwareintomobile 11 28-2012
Extending softwareintomobile 11 28-2012
 

Similaire à Ultrabook Development Using Touch - Intel Ultrabook AppLab Berlin

Designing for Touch and Sensor for Mobiles & Tablets
Designing for Touch and Sensor for Mobiles & TabletsDesigning for Touch and Sensor for Mobiles & Tablets
Designing for Touch and Sensor for Mobiles & TabletsSameer Chavan
 
600.250 UI Cross Platform Development and the Android Security Model
600.250 UI Cross Platform Development and the Android Security Model600.250 UI Cross Platform Development and the Android Security Model
600.250 UI Cross Platform Development and the Android Security ModelMichael Rushanan
 
Developing Multi Touch Applications
Developing Multi Touch ApplicationsDeveloping Multi Touch Applications
Developing Multi Touch ApplicationsBrian Blanchard
 
Utilisation des capteurs dans les applications windows 8
Utilisation des capteurs dans les applications windows 8Utilisation des capteurs dans les applications windows 8
Utilisation des capteurs dans les applications windows 8Intel Developer Zone Community
 
LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8
LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8
LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8Microsoft Mobile Developer
 
Windows 10 Hybrid Development
Windows 10 Hybrid DevelopmentWindows 10 Hybrid Development
Windows 10 Hybrid DevelopmentMax Kleiner
 
SMARCOS HIG Paper on Designing Touch Screen Interfaces
SMARCOS HIG Paper on Designing Touch Screen InterfacesSMARCOS HIG Paper on Designing Touch Screen Interfaces
SMARCOS HIG Paper on Designing Touch Screen InterfacesSmarcos Eu
 
Operating Systems
Operating SystemsOperating Systems
Operating SystemsLeon Lei
 
Designing Rich Mobile Apps in a Fragmented World
Designing Rich Mobile Apps in a Fragmented WorldDesigning Rich Mobile Apps in a Fragmented World
Designing Rich Mobile Apps in a Fragmented WorldWorklight
 
Adapting Series 40 touch and type apps to the full-touch UI
Adapting Series 40 touch and type apps to the full-touch UIAdapting Series 40 touch and type apps to the full-touch UI
Adapting Series 40 touch and type apps to the full-touch UIMicrosoft Mobile Developer
 
Touch Screen
Touch ScreenTouch Screen
Touch ScreenIonela
 
Win7 Multi Touch
Win7 Multi TouchWin7 Multi Touch
Win7 Multi TouchDaniel Egan
 
Practical UI Guidelines for Wearable Apps
Practical UI Guidelines for Wearable AppsPractical UI Guidelines for Wearable Apps
Practical UI Guidelines for Wearable AppsVictor Dibia
 
Building a multi touch enabled windows 7 point of sale system
Building a multi touch enabled windows 7 point of sale systemBuilding a multi touch enabled windows 7 point of sale system
Building a multi touch enabled windows 7 point of sale systemChris Eargle
 

Similaire à Ultrabook Development Using Touch - Intel Ultrabook AppLab Berlin (20)

Designing for Touch and Sensor for Mobiles & Tablets
Designing for Touch and Sensor for Mobiles & TabletsDesigning for Touch and Sensor for Mobiles & Tablets
Designing for Touch and Sensor for Mobiles & Tablets
 
Moderne device management door middel van cloud
Moderne device management door middel van cloudModerne device management door middel van cloud
Moderne device management door middel van cloud
 
600.250 UI Cross Platform Development and the Android Security Model
600.250 UI Cross Platform Development and the Android Security Model600.250 UI Cross Platform Development and the Android Security Model
600.250 UI Cross Platform Development and the Android Security Model
 
Developing Multi Touch Applications
Developing Multi Touch ApplicationsDeveloping Multi Touch Applications
Developing Multi Touch Applications
 
Manu
ManuManu
Manu
 
Utilisation des capteurs dans les applications windows 8
Utilisation des capteurs dans les applications windows 8Utilisation des capteurs dans les applications windows 8
Utilisation des capteurs dans les applications windows 8
 
LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8
LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8
LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8
 
Pc03
Pc03Pc03
Pc03
 
Windows 10 Hybrid Development
Windows 10 Hybrid DevelopmentWindows 10 Hybrid Development
Windows 10 Hybrid Development
 
Embedded Virtualization for Mobile Devices
Embedded Virtualization for Mobile DevicesEmbedded Virtualization for Mobile Devices
Embedded Virtualization for Mobile Devices
 
SMARCOS HIG Paper on Designing Touch Screen Interfaces
SMARCOS HIG Paper on Designing Touch Screen InterfacesSMARCOS HIG Paper on Designing Touch Screen Interfaces
SMARCOS HIG Paper on Designing Touch Screen Interfaces
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Android Virtualization: Opportunity and Organization
Android Virtualization: Opportunity and OrganizationAndroid Virtualization: Opportunity and Organization
Android Virtualization: Opportunity and Organization
 
Designing Rich Mobile Apps in a Fragmented World
Designing Rich Mobile Apps in a Fragmented WorldDesigning Rich Mobile Apps in a Fragmented World
Designing Rich Mobile Apps in a Fragmented World
 
Adapting Series 40 touch and type apps to the full-touch UI
Adapting Series 40 touch and type apps to the full-touch UIAdapting Series 40 touch and type apps to the full-touch UI
Adapting Series 40 touch and type apps to the full-touch UI
 
Touch Screen
Touch ScreenTouch Screen
Touch Screen
 
Win7 Multi Touch
Win7 Multi TouchWin7 Multi Touch
Win7 Multi Touch
 
Tablet pc
Tablet pcTablet pc
Tablet pc
 
Practical UI Guidelines for Wearable Apps
Practical UI Guidelines for Wearable AppsPractical UI Guidelines for Wearable Apps
Practical UI Guidelines for Wearable Apps
 
Building a multi touch enabled windows 7 point of sale system
Building a multi touch enabled windows 7 point of sale systemBuilding a multi touch enabled windows 7 point of sale system
Building a multi touch enabled windows 7 point of sale system
 

Plus de Intel Developer Zone Community (8)

Intel Developer Zone MeetUp Intro
Intel Developer Zone MeetUp IntroIntel Developer Zone MeetUp Intro
Intel Developer Zone MeetUp Intro
 
Intel® Developer Zone
Intel® Developer ZoneIntel® Developer Zone
Intel® Developer Zone
 
Android and Intel Inside
Android and Intel InsideAndroid and Intel Inside
Android and Intel Inside
 
Ultrabook Development Using Sensors - Intel AppLab Berlin
Ultrabook Development Using Sensors - Intel AppLab BerlinUltrabook Development Using Sensors - Intel AppLab Berlin
Ultrabook Development Using Sensors - Intel AppLab Berlin
 
The New Windows UI - Intel Ultrabook AppLab Berlin
The New Windows UI - Intel Ultrabook AppLab BerlinThe New Windows UI - Intel Ultrabook AppLab Berlin
The New Windows UI - Intel Ultrabook AppLab Berlin
 
Intel AppUp Webinar Italiano html5
Intel AppUp Webinar Italiano html5Intel AppUp Webinar Italiano html5
Intel AppUp Webinar Italiano html5
 
Overview Intel AppUp developer program
Overview Intel AppUp developer programOverview Intel AppUp developer program
Overview Intel AppUp developer program
 
Getting Your Windows and MeeGo Apps into AppUp
Getting Your Windows and MeeGo Apps into AppUpGetting Your Windows and MeeGo Apps into AppUp
Getting Your Windows and MeeGo Apps into AppUp
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Dernier (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Ultrabook Development Using Touch - Intel Ultrabook AppLab Berlin

  • 1. APPLICATION DEVELOPMENT WITH TOUCH AND SENSORS ON ULTRABOOKTM / WINDOWS 8 Sulamita Garcia – sulamita.garcia@intel.com Technical Marketing Engineer Twitter @sulagarcia Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 1
  • 2. /me
  • 3. MAHJONG DEMO HERE Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 3
  • 4. Using touch in a desktop application • Touch and gestures – Tap/Double tap – Zoom – Panning with inertia – Rotate – Selection/Drag – Two-finger tap – Press and tap – Flicks – Press and hold • Do’s and Don’t of gesture interfaces • Demo: Use touch and gestures to select, move and manipulate three images • The Windows Touch API • Using touch with XMAL Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 4
  • 5. Adding touch to a desktop application • Touch is not a mouse • Make touch targets large enough • Support standard gestures and behaviors • Portrait vs. Landscape • Do not use touch just for touch’s sake • Touch should be forgiving • Microsoft User Experience Guidelines – msdn.microsoft.com/en- us/library/windows/desktop/cc872774.aspx – blogs.msdn.com/b/ie/archive/2012/04/20/guidelines-for- building-touch-friendly-sites.aspx Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 5
  • 6. Designing for Touch User Experience • Design UI to include traditional laptop style and tablet mode usages • Space and size controls to register fuzzy touch input – Common Controls: 23X23 pixels – Command Controls: 40X40 pixels • Use multiple form tabs for touch efficiency • Consider the target size while designing your application UI • Use natural and intuitive controls • Ultrabook Optimal Resolution: 1366X768 Source: MSDN http://msdn.microsoft.com/en-us/library/windows/desktop/cc872774.aspx#guidelines Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 6
  • 7. Designing for Touch User Experience • Use common controls as much as possible • Choose custom controls that support touch • Prefer constrained controls to unconstrained controls • Provide default values and auto text- completion • Use check boxes instead of multiple selection lists Source: MSDN http://msdn.microsoft.com/en-us/library/windows/desktop/cc872774.aspx#guidelines Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 7
  • 8. Designing for Touch User Experience • Place controls in areas better utilized for touch • Command controls should be more easily accessible Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 8
  • 9. Using Windows Touch API • Touch and gesture events are delivered via Windows Touch messages – Windows must register for Windows Touch input • WM_TOUCH reports action, position and identifier • WM_GESTURE describes the gesture via GESTUREINFO structure • Special interfaces to help process gesture messages – IManipulationProcessor – IInertiaProcessor • API reference at msdn.microsoft.com/en- us/library/windows/desktop/dd371406%28v=vs.85%2 9.aspx Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 9
  • 10. Sensors and Windows Native • Sensor manager controls sensors – Use sensor manager to get to sensors – Notifies when a sensor connects • Sensors report data, changes in state and disconnection • Access both via COM interfaces – Use API to communicate to sensors – Sensor events handled using callbacks – API reference at msdn.microsoft.com/en- us/library/windows/desktop/dd318953%28v=vs.85%2 9.aspx Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 10
  • 11. WinNative: Receive gesture message LRESULT CALLBACK WndProc(…) { … switch (message) { • Check for case WM_GESTURE: // Call code to WM_GESTURE message // interpret the in WndProc // gesture return DecodeGesture(…); … } (Source: Microsoft) Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 11
  • 12. WinNative: Process gesture LRESULT DecodeGesture(…) { • Retrieve the additional … BOOL bResult = GetGestureInfo(…); gesture information from BOOL bHandled = FALSE; the GESTUREINFO if (bResult) structure { // now interpret the gesture switch (gi.dwID){ case GID_ZOOM : // Code for zooming goes here bHandled = TRUE; • Handle each of the break; case GID_PAN : possible gestures … case GID_ROTATE : … case GID_TWOFINGERTAP: … case GID_PRESSANDTAP: … default: // A gesture was not recognized break; } … (Source: Microsoft) Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 12
  • 13. Demo • New Windows*8 UI application – Full screen – Borderless window • Desktop application – Runs in desktop environment Source: Microsoft – Multiple windows – Can support touch and sensors Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 13
  • 14. Using touch and XAML/.NET • XAML provides access to WPF touch-enabled UI components – WPF touchs event are available in both Windows* 7 and Windows* 8. • Typical gesture events: – ManipulationStarting – ManipulationDelta – ManipulationInertiaStarting Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 14
  • 15. XAML: TouchControl.xaml <UserControl x:Class="Win8Demo.TouchControl" • Three images placed in …> a Grid inside of a <Grid x:Name="cont" ClipToBounds="True" > <!-- Set the IsManipulationEnabled to TouchControl true --> <Image x:Name="photo_1" Source="/Assets/ultrabook1.png“ IsManipulationEnabled="True" Width="500" /> • Each image has <Image x:Name="photo_2“ Source="/Assets/ultrabook2.png“ IsManipulationEnabled IsManipulationEnabled="True“ Width="500" Margin="125,-79,25,79"/> <Image x:Name="photo_3“ set to true Source="/Assets/ultrabook3.png“ IsManipulationEnabled="True“ Width="500" Margin="0,-59,150,59" /> </Grid> </UserControl> Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 15
  • 16. Touch Event State Diagram Events begin with User Manipulation Touching the Image Starting Manipulation Manipulation Delta Manipulation Inertia Starting w/ Inertia Delta User finger is lifted from the screen User finger is touching the screen Manipulation Completed Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 16
  • 17. XAML: TouchControl.xaml.cs public TouchControl() { … //Register for manipulation events • Add event handlers to photo_1.ManipulationStarting += m_rect_ManipulationStarting; photo_1.ManipulationDelta += each image for: m_rect_ManipulationDelta; photo_1.ManipulationInertiaStarting += •ManipulationStarting m_rect_ManipulationInertiaStarting; •ManipulationDelta photo_2.ManipulationStarting += … •ManipulationInertiaStarting photo_3.ManipulationStarting += … } Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 17
  • 18. Touch Event State Diagram Events begin with User Manipulation Touching the Image Starting Manipulation Manipulation Delta Manipulation Inertia Starting w/ Inertia Delta User finger is lifted from the screen User finger is touching the screen Manipulation Completed Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 18
  • 19. XAML: Manipulation starting event handler • ManipulationStarting event void handler is called at start of m_rect_ManipulationStarting touch event (…) { … • By setting Manipulation- e.ManipulationContainer = Container to the touched this; image all subsequent manipulation events will be } relative to that element Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 19
  • 20. Touch Event State Diagram Events begin with User Manipulation Touching the Image Starting Manipulation Manipulation Delta Manipulation Inertia Starting w/ Inertia Delta User finger is lifted from the screen User finger is touching the screen Manipulation Completed Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 20
  • 21. XAML: Manipulation delta event handler • ManipulationDelta void m_rect_ManipulationDelta(…) { event happens as user … //Get the manipulation’s delta moves fingers var delta = e.DeltaManipulation; //Compute the transformed center point Point rectCenter = new Point(rect.ActualWidth * 0.5, rect.ActualHeight * 0.5); • Compute new image rectCenter = matrix.Transform(rectCenter); center point, scale, and //Adjust the element’s scale, rotation and translation rotation using event matrix.ScaleAt(delta.Scale.X, delta.Scale.Y, rectCenter.X, rectCenter.Y); data matrix.RotateAt(delta.Rotation, rectCenter.X, rectCenter.Y); matrix.Translate(delta.Translation.X, delta.Translation.Y); • Set Handled to true so //Update the element’s render transformation rect.RenderTransform = other handlers don’t new MatrixTransform(matrix); process same event e.Handled = true; Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 21
  • 22. Touch Event State Diagram Events begin with User Manipulation Touching the Image Starting Manipulation Manipulation Delta Manipulation Inertia Starting w/ Inertia Delta User finger is lifted from the screen User finger is touching the screen Manipulation Completed Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 22
  • 23. XAML: Inertia starting event handler • Inertia actions are handled by the void m_rect_ManipulationInertiaStarting(…) { ManipulationInertiaStarting event //Set the manipulations inertia values handler e.TranslationBehavior = new InertiaTranslationBehavior() • Define the behavior of the inertia { by specifying InitialVelocity = e.InitialVelocities.LinearVelocity, • Linear velocity DesiredDeceleration =… • Deceleration }; • Expansion velocity (used in e.ExpansionBehavior = new InertiaExpansionBehavior() pinch or spread) { • Angular velocity (used in InitialVelocity = e.InitialVelocities.ExpansionVelocity, rotation) DesiredDeceleration = … }; e.RotationBehavior = new InertiaRotationBehavior() { InitialVelocity = • Again, set Handled to true so other e.InitialVelocities.AngularVelocity, DesiredDeceleration = … handlers don’t process same event }; e.Handled = true;… Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 23
  • 24. Touch Event State Diagram Events begin with User Manipulation Touching the Image Starting Manipulation Manipulation Delta Manipulation Inertia Starting w/ Inertia Delta User finger is lifted from the screen User finger is touching the screen Manipulation Completed Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 24
  • 25. XAML: Handle inertia manipulation if (e.IsInertial) • Check if inertia is moving the { image across the grid //Get the containing element’s size Rect containingRect = … (e.ManipulationContainer).RenderSize); //Get the transformed element’s new //bounds Rect shapeBounds = rect.RenderTransform.TransformBounds (…); //If element falls out of bounds • If so, make sure image does not if (!containingRect.Contains(shapeBounds)) travel outside of the grid by { //Report boundary feedback calling the Complete method to e.ReportBoundaryFeedback(…); end the inertia //Stop any after inertia e.Complete(); } } … Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 25
  • 26. References • Intel Ultrabook™ Community • Intel® Software Network – software.intel.com • Windows Development Reference – msdn.microsoft.com/en- us/library/windows/desktop/hh447209%28v=vs.85%2 9.aspx • WinRT API Reference – msdn.microsoft.com/en- us/library/windows/apps/br211377.aspx Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 26
  • 27. Q&A Sulamita Garcia – sulamita.garcia@intel.com Technical Marketing Engineer Twitter @sulagarcia Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 27