今天写代码时遇到要用后台C#代码定义一个PictureMarkerSymbol,以前只用XAML写过,不会,遂找来谷哥,百度到帖子如下,后来又通过微软的MSDN找到另一个方法,现列在下面,留存作为备忘查询帖。
方法一:(http://blog.youkuaiyun.com/swfcsunboy/archive/2008/03/01/2136781.aspx)
Subject | How to create a PictureMarkerSymbol (Picture Symbol)in ArcGIS server with C# |
---|---|
Author | fei wang |
Date | Oct 13, 2007 |
Message | I had spent long time for finding sample code that can show me how to create a PictureMarkerSymbol in ArcGIS server with C#. However, I couldn't find it.
方法二:(http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.bitmapsource.aspx) // Create the image element. Image simpleImage = new Image(); simpleImage.Width = 200; simpleImage.Margin = new Thickness(5); // Create source. BitmapImage bi = new BitmapImage(); // BitmapImage.UriSource must be in a BeginInit/EndInit block. bi.BeginInit(); bi.UriSource = new Uri(@"/sampleImages/cherries_larger.jpg",UriKind.RelativeOrAbsolute); bi.EndInit(); // Set the image source. simpleImage.Source = bi; |