我在silverlight中想画polyline或polygon。

当第3点的x的<第1点时整个图会向右移。但当第三3的x>第2点时没问题.

为什么会这样。如果解决。当第3点的x<第1点时可以画图但,整个图不向右移动呀。。

谢谢

mousedown (我放在 root canvas)

第一次设置polyline's left and top 属性 = _LS.X & _LS.Y

                pl.SetValue(Canvas.LeftProperty, _LS.X);
                pl.SetValue(Canvas.TopProperty, _LS.Y);

 

PointCollection _pc = new PointCollection();

            _LS.X = e.GetPosition(LayoutRoot).X;
            _LS.Y = e.GetPosition(LayoutRoot).Y;

            _pc.Add(_LS);

pl.Points = _pc;

============

<Canvas MouseLeftButtonDown.........> //root

    <Canvas x:Name="LayoutRoot" Background="Transparent"  Height="600" Width="800" Canvas.Left="0" Canvas.Top="0">

        <Polyline x:Name="pl" Stretch="Fill" Stroke="Black" Opacity="0.9" StrokeLineJoin="Bevel"  />
      
    </Canvas>

</Canvas>

 

posted @ 2008-07-07 16:36 reaper 阅读(191) | 评论 (6)编辑
     摘要: IntroductionimportantThis topic applies to Silverlight version 1.1. It has not been updated for Silverlight version 2.The Microsoft Silverlight plugin supports an extensive programming model that incl... 阅读全文
posted @ 2008-04-14 23:29 reaper 阅读(27) | 评论 (0)编辑
From:http://silverlight.net

Introduction

important

This topic applies to Silverlight version 1.1. It has not been updated for Silverlight version 2.

Microsoft Silverlight projects must reference the .NET Framework assemblies that are installed with Silverlight instead of those that are installed with Visual Studio. You can customize the Visual Studio Object Browser to view only the Silverlight assemblies.

note

The Silverlight assemblies include both members that can be used in Silverlight-based applications and members that can be referenced only by .NET Framework code. The members that cannot be used in Silverlight-based applications are identified by the presence of the SecurityCriticalAttribute attribute. The presence of this attribute is not visible in the Object Browser, so you cannot discern which members can be used for Silverlight-based applications. However, you will see the prefix "[SECURITY CRITICAL]" in the IntelliSense view of members that have the SecurityCriticalAttribute. The Silverlight documentation also specifies which types and members are security-critical. If you use a security-critical member in your code, you will get an exception when you attempt to execute that member in a Silverlight-based application.

Prerequisites (available from the Silverlight download site):

  • Silverlight version 2.

  • Microsoft Visual Studio 2008.

  • Silverlight Tools Beta for Visual Studio 2008.

To select the Silverlight assemblies to view

  1. On the View menu, click Object Browser to open the Visual Studio Object Browser.

  2. In the Browse combo box, click Edit Custom Component Set. The Edit Custom Component Set dialog box will open.

  3. In the Edit Custom Component Set dialog box, click the Browse tab, and browse to the Program Files\Microsoft Silverlight folder.

  4. Select all the files. Click the Add button, and then click OK. The Object Browser automatically determines which assemblies contain managed code. A message box that identifies the unmanaged assemblies is displayed (these assemblies are not added), and all the managed assemblies appear in the custom component set.

To view a Silverlight assembly

  1. In the Object Browser, click the plus sign next to an assembly name to view the namespaces and types in that assembly.

    When you click a type to view its members, remember that all members are shown, including security-critical members that can be accessed only from library code. To avoid the use of security-critical members when creating a Silverlight-based application, look for the security-critical warning in IntelliSense.

posted @ 2008-04-14 23:27 reaper 阅读(11) | 评论 (0)编辑
主要问题是
BrowserHost.Resize已经改为Application.Current.Host.Content.Resized
BrowserHost.ActualWidth改为Application.Current.Host.Content.ActualWidth
别的一样
改后的代码:(在cnblogs里找的)
Application.Current.Host.Content.Resized += new EventHandler(Content_Resize);
void Content_Resize(object sender, EventArgs e) {
           
double xscale = Application.Current.Host.Content.ActualWidth / this.Width;
          
double yscale = Application.Current.Host.Content.ActualWidth / this.Height;
           ScaleTransform scale 
= new ScaleTransform();
           scale.ScaleX 
= xscale ;
            scale.ScaleY 
= yscale ;
            RenderTransform 
= scale;
        }
posted @ 2008-04-14 23:14 reaper 阅读(26) | 评论 (0)编辑

GIS的东东,用了头的方案,我的写了半天。。不用了。。。哎。。。.

不过在空余的时间我还要想继续完善我的东东。。我还是喜欢我的。。hoho....

最近又要学silverlight2了。。。

开发中的web gis 还没完成(用公司自己的DB与控件,没用第三方的。)。。。

posted @ 2008-04-07 02:47 reaper 阅读(11) | 评论 (0)编辑
目前忙着研究GIS相关的东东。。所以。。。。
posted @ 2008-03-17 03:21 reaper 阅读(9) | 评论 (0)编辑