当前位置: 首页>>代码示例>>C#>>正文


C# Map.AddSymbol方法代码示例

本文整理汇总了C#中Map.AddSymbol方法的典型用法代码示例。如果您正苦于以下问题:C# Map.AddSymbol方法的具体用法?C# Map.AddSymbol怎么用?C# Map.AddSymbol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Map的用法示例。


在下文中一共展示了Map.AddSymbol方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenderToMap

        // Render the description into the given map at the given location in the given color.
        public void RenderToMap(Map map, SymColor color, PointF point, Dictionary<object, SymDef> dict)
        {
            IRenderer renderer = new MapRenderer(map, color, dict);

            // Set the correct transform.
            Matrix mat = new Matrix();
            mat.Scale(1, -1);      // flip Y axis.
            mat.Translate(point.X, -point.Y);
            renderer.Transform = mat;

            // White out the background.
            SizeF size = Measure();
            PointKind[] kinds = { PointKind.Normal, PointKind.Normal, PointKind.Normal, PointKind.Normal, PointKind.Normal};
            PointF[] pts = {Geometry.TransformPoint(new PointF(0, 0), mat), Geometry.TransformPoint(new PointF(size.Width, 0), mat),Geometry.TransformPoint(new PointF(size.Width, size.Height), mat),
                Geometry.TransformPoint(new PointF(0, size.Height), mat),Geometry.TransformPoint(new PointF(0, 0), mat) };
            SymPath path = new SymPath(pts, kinds);
            AreaSymbol whiteout = new AreaSymbol((AreaSymDef) dict[CourseLayout.KeyWhiteOut], new SymPathWithHoles(path, null), 0, new PointF());
            map.AddSymbol(whiteout);

            replaceMultiplySign = false;   // OCAD doesn't handle the multiple character well.
            Render(renderer, new RectangleF(-100000, -100000, 200000, 200000), 0, description.Length);
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:23,代码来源:DescriptionRenderer.cs

示例2: RenderSymbolToMap

        // Test for rendering into a map.
        // Render one course object to a map.
        internal Map RenderSymbolToMap(Symbol sym, float boxSize)
        {
            Map map = new Map(new GDIPlus_TextMetrics(), null);

            using (map.Write()) {
                //Dictionary<object, SymDef> dict = new Dictionary<object, SymDef>();
                SymColor symColor = map.AddColor("Purple", 11, 0.045F, 0.59F, 0, 0.255F, false);
                PointSymDef symdef = sym.CreateSymdef(map, symColor, boxSize);
                PointSymbol symbol = new PointSymbol(symdef, new PointF(0,0), 0, null);
                map.AddSymbol(symbol);
            }
            return map;
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:15,代码来源:SymbolDBTests.cs

示例3: AddToMap

        protected override void AddToMap(Map map, SymDef symdef)
        {
            TextSymbol sym = new TextSymbol((TextSymDef) symdef, new string[1] { text }, topLeft, 0, 0, TextSymDefHorizAlignment.Default, TextSymDefVertAlignment.Default);

               /*Show size of text
            * PointF[] pts = { topLeft, new PointF(topLeft.X, topLeft.Y - size.Height), new PointF(topLeft.X + size.Width, topLeft.Y - size.Height), new PointF(topLeft.X + size.Width, topLeft.Y), topLeft };
               PointKind[] kinds = { PointKind.Normal, PointKind.Normal, PointKind.Normal, PointKind.Normal, PointKind.Normal };
               SymPathWithHoles path = new SymPathWithHoles(new SymPath(pts, kinds), null);
               AreaSymbol sym = new AreaSymbol((AreaSymDef) symdef, path, 0); */

               map.AddSymbol(sym);
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:12,代码来源:CourseObject.cs


注:本文中的Map.AddSymbol方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。