本文整理汇总了C#中Symbol.Draw方法的典型用法代码示例。如果您正苦于以下问题:C# Symbol.Draw方法的具体用法?C# Symbol.Draw怎么用?C# Symbol.Draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symbol
的用法示例。
在下文中一共展示了Symbol.Draw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderToBitmap
internal static Bitmap RenderToBitmap(Symbol sym)
{
Bitmap bm = new Bitmap(256, 256);
Graphics g = Graphics.FromImage(bm);
g.Clear(Color.White);
RectangleF rect = new RectangleF(0.0F, 0.0F, 256.0F, 256.0F);
sym.Draw(g, Color.Black, rect);
g.Dispose();
return bm;
}
示例2: RenderSymbolMapToBitmap
// Render a course to a bitmap for testing purposes.
internal Bitmap RenderSymbolMapToBitmap(Symbol sym)
{
Map map = RenderSymbolToMap(sym, 8.0F);
Bitmap bm = new Bitmap(250, 250);
using (Graphics g = Graphics.FromImage(bm)) {
RenderOptions options = new RenderOptions();
options.usePatternBitmaps = true;
options.minResolution = (float) (8.0 / bm.Width);
options.renderTemplates = RenderTemplateOption.MapAndTemplates;
Matrix saveTransform = g.Transform;
g.MultiplyTransform(GetTransform(bm.Size));
g.Clear(Color.White);
DrawGrid(g, new RectangleF(-4.0F, -4.0F, 8.0F, 8.0F), 1.0F);
using (map.Read())
map.Draw(new GDIPlus_GraphicsTarget(g), new RectangleF(-100F, -100F, 200F, 200F), options, null);
// Now use normal drawing to super-impose.
g.Transform = saveTransform;
RectangleF rect = new RectangleF(0.0F, 0.0F, bm.Width, bm.Height);
sym.Draw(g, Color.FromArgb(50, Color.Black), rect);
}
return bm;
}