Any code samples to use pinch to zoom in Windows 7?

Any code samples to use pinch to zoom in Windows 7?

There is touch screen in Ultrabook then how to apply these basic touch operations on Windows 7 and Windows 8 Desktop?

11 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

I did not see any code samples but here is a beginner's article about touch in desktop applications that will get you started.

Thanks,
Rumnha

I am using C++ in Windows 8 Desktop. It is not Windows RT. I think it may be something handled by WM_TOUCH for general Windows. WPF seems apply to XAML canvas only.  

Multi-Touch Manipulation Events in WPF

I tried the sample in this link and it works pretty good as well.

Raghavendra Ural

@Bill

Getting Started with Windows Touch Gestures

This is the solution I needed. In the code below

switch (gi.dwID) {
    case GID_ZOOM: // Code for zooming goes here
    bHandled = TRUE; break;

what I want is to resize the Window by Zoom-in/out. Any solution?

H!

See the Quickstart: Touch input for an overview of touch and manipulation events. The sample code given there handles translation rather than scaling, but it's straightforward to include rotation and scaling:

Xaml:

<Rectangle Name="TestRectangle" Width="200" Height="200" Fill="Blue" ManipulationMode="All" />
Code behind:

public MainPage() {

         InitializeComponent(); // Add handler for the ManipulationDelta event
         TestRectangle.ManipulationDelta += new ManipulationDeltaEventHandler((sender, e) => {
                    UIElement element = sender as UIElement;
                    CompositeTransform transform = element.RenderTransform as CompositeTransform;
                    if (transform != null) {
                              transform.ScaleX *= e.DeltaManipulation.Scale;
                              transform.ScaleY *= e.DeltaManipulation.Scale;
                              transform.Rotation += e.DeltaManipulation.Rotation * 180 / Math.PI;
                              transform.TranslateX += e.DeltaManipulation.Translation.X;
                              transform.TranslateY += e.DeltaManipulation.Translation.Y;
                        }
              });
             TestRectangle.RenderTransform = new CompositeTransform();
}

I dont think so u can use pinch and zoom in windows 7

try this link. I see a pretty good example here.

http://msdn.microsoft.com/en-us/magazine/ff898416.aspx

 

Raghavendra Ural

Quote:

Shashi wrote:

I dont think so u can use pinch and zoom in windows 7

Maybe you are right. So far I have not found a solution for native Windows (not WFP).

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi