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

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

imagem de chang-li

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

11 posts / 0 new
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
imagem de Rumnha

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
imagem de Bill Chung
imagem de chang-li

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.  

imagem de Bill Chung
imagem de Ural (Intel)

Multi-Touch Manipulation Events in WPF

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

Ural
imagem de chang-li

@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?

imagem de Sami Ayari

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();
}

imagem de Shashi

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

imagem de Ural (Intel)

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

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

 

Ural
imagem de chang-li

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).

Faça login para deixar um comentário.