English 中文(简体)
如何控制在视窗电话展示更大形象 7
原标题:What control to use to display larger image on Windows Phone 7

我愿在7台窗户电话中展示更大的形象。 我需要能够动.,使用多光谱姿态。 我很想知道,在Windows Telephone 7 SDK的盒子中,是否有任何控制能够做到这一点?

最佳回答

如果你不希望使用深Z,你还可以使用ViewBox,以包含图像,并听取GisBox使用“Rendertransform”在和从该观点中流出的骨折射/偶和zo。

下面是我用于银灯的一些代码,其中某些工作可以改变,以对平方作出反应,而不是用 mo轮+点击/d。 也可能根据胎体的“体积”改变动物体积。

在XAML中定义的一个观点箱:

    <Border Name="viewboxBackground" Background="Black">
            <Viewbox Name="viewboxMain">
                <!--your content here -->
            </Viewbox>
    </Border>   

准则背后:

    #region Pan and Zoom Events and Handlers

    void MouseClickHandler(object sender, MouseButtonEventArgs e)
    {
        _mouseClickPos = e.GetPosition(viewboxBackground);
        bMoving = true;
    }

    void MouseMoveHandler(object sender, MouseEventArgs e)
    {

        if (bMoving)
        {
            //get current transform
            CompositeTransform transform = viewboxMain.RenderTransform as CompositeTransform;

            Point currentPos = e.GetPosition(viewboxBackground);
            transform.TranslateX += (currentPos.X - _mouseClickPos.X);
            transform.TranslateY += (currentPos.Y - _mouseClickPos.Y);

            viewboxMain.RenderTransform = transform;

            _mouseClickPos = currentPos;
        }
    }

    void MouseReleaseHandler(object sender, MouseButtonEventArgs e)
    {
        bMoving = false;
    }

    void MouseWheelZoom(object sender, MouseWheelEventArgs e)
    {
        if (e.Delta > 0)
        {
            _zoomMultiplier += _zoomRate;
            ApplyZoomTransform(viewboxMain, _zoomMultiplier, new Point(viewboxMain.ActualWidth / 2, viewboxMain.ActualHeight / 2));
        }
        else if (e.Delta < 0 && _zoomMultiplier > 1)
        {
            _zoomMultiplier -= _zoomRate;
            ApplyZoomTransform(viewboxMain, _zoomMultiplier, new Point(viewboxMain.ActualWidth / 2, viewboxMain.ActualHeight / 2));
        }
    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="element"></param>
    /// <param name="iZoomFactor"></param>
    /// <param name="zoomCenter">If provided, the zoom will be centered around the given position.</param>
    void ApplyZoomTransform(UIElement element, double iZoomFactor, Point? zoomCenter)
    {
        //get current transform
        CompositeTransform transform = viewboxMain.RenderTransform as CompositeTransform;

        if (zoomCenter != null)
        {
            transform.CenterX = zoomCenter.GetValueOrDefault().X;
            transform.CenterY = zoomCenter.GetValueOrDefault().Y;
        }
        transform.ScaleX = iZoomFactor;
        transform.ScaleY = iZoomFactor;

        element.RenderTransform = transform;
    }

    #endregion
问题回答

You might be interested in DeepZoom. Not sure how well it supports multi-touch gesture out the box, but you can learn about using gestures here and simulating multi-touch here, if multi-touch support isn t standard. Here s an example video of DeepZoom on WP7.

你们还可以发现洛朗·布格尼翁的多图行为,值得一看血清图像。

多氯 Behavior





相关问题
Silverlight Rich text box control

Our team decided that we need our own custom Rich text box control for Silverlight app we are developing. We looked at existing controls mentioned at A good rich text control for Silverlight but ...

Silverlight ImageBrush not rendering (with Bing Map Control)

I m trying to add an image to a Pushpin instance from the Silverlight Bing Map Control, but I can t seem to get it to render (the pushpin renders fine). This is probably a general WPF question rather ...

Silverlight OpenFileDialog DoEvents equivalent

I m processing large files after they are selected by the user. My code looks like the following: if (FileDialog.ShowDialog() == true) { // process really big file } This freezes up the UI so ...

list of controls with templates in silverlight

Does anyone know where to find a list of controls that you can set the template on in Silverlight? I ve wasted several hours now trying to create control templates only to find that the control doesn ...

Silverlight, Updating the UI during processing

I have a simple silverlight multifile upload application, and i want to provide the user with some feedback, right now its only in a test phase and i dont have the webservice. Somehow i cant get the ...

Silverlight 3 - FindName returns null

This looks a bug to me.. Using Silverlight 3 and i have a user control defined in XAML and trying to access the object during runtime returns a null. <Grid> <common:CommonGridEditPanel x:...

silverlight 3 collection binding

Someone please help me understand why this binding does not work... I have a class called SelectionManager with a property called dates which is populated by a WCF service. The property is an ...

热门标签