本文整理汇总了C#中Glyph.ConstructionComplete方法的典型用法代码示例。如果您正苦于以下问题:C# Glyph.ConstructionComplete方法的具体用法?C# Glyph.ConstructionComplete怎么用?C# Glyph.ConstructionComplete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Glyph
的用法示例。
在下文中一共展示了Glyph.ConstructionComplete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateSymdef
// Create a point symbol that can be used to put this symbol onto a map inside
// a box of the given size (in mm).
public PointSymDef CreateSymdef(Map map, SymColor color, float boxSize)
{
Glyph glyph = new Glyph();
for (int i = 0; i < strokes.Length; ++i)
strokes[i].AddToMapGlyph(glyph, color, boxSize);
glyph.ConstructionComplete();
// Find a free OCAD ID number.
string symbolId = map.GetFreeSymbolId(800);
// Create the symdef
PointSymDef symdef;
symdef = new PointSymDef("Description: " + this.GetName(Util.CurrentLangName()), symbolId, glyph, false);
// Create the toolbox image.
Bitmap bm = new Bitmap(24, 24);
using (Graphics g = Graphics.FromImage(bm)) {
g.Clear(Color.White);
g.SmoothingMode = SmoothingMode.AntiAlias;
if (kind >= 'T') {
g.SetClip(new RectangleF(0, 0, bm.Width / 2, bm.Height));
Draw(g, Color.Black, new RectangleF(0, bm.Height / 3F, bm.Width * 8F / 3F, bm.Height / 3F));
g.SetClip(new RectangleF(bm.Width / 2, 0, bm.Width / 2, bm.Height));
Draw(g, Color.Black, new RectangleF(- bm.Width * 5F / 3F, bm.Height / 3F, bm.Width * 8F / 3F, bm.Height / 3F));
}
else {
Draw(g, Color.Black, new RectangleF(0, 0, bm.Width, bm.Height));
}
}
symdef.ToolboxImage = MapUtil.CreateToolboxIcon(bm);
// Add the symdef to the map.
map.AddSymdef(symdef);
return symdef;
}
示例2: CreateSymDef
protected override SymDef CreateSymDef(Map map, SymColor symColor)
{
Glyph glyph = new Glyph();
glyph.AddCircle(symColor, new PointF(0.0F, 0.0F), NormalCourseAppearance.lineThickness * scaleRatio * appearance.lineWidth, diameter * scaleRatio * appearance.controlCircleSize);
if (appearance.centerDotDiameter > 0.0F) {
glyph.AddFilledCircle(symColor, new PointF(0.0F, 0.0F), appearance.centerDotDiameter * scaleRatio);
}
glyph.ConstructionComplete();
PointSymDef symdef = new PointSymDef("Control point", "702", glyph, false);
symdef.ToolboxImage = MapUtil.CreateToolboxIcon(Properties.Resources.Control_OcadToolbox);
map.AddSymdef(symdef);
return symdef;
}