本文整理汇总了C#中ILineString.TransformToImage方法的典型用法代码示例。如果您正苦于以下问题:C# ILineString.TransformToImage方法的具体用法?C# ILineString.TransformToImage怎么用?C# ILineString.TransformToImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILineString
的用法示例。
在下文中一共展示了ILineString.TransformToImage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawLineString
/// <summary>
/// Renders a LineString to the map.
/// </summary>
/// <param name="g">IGraphics reference</param>
/// <param name="line">LineString to render</param>
/// <param name="pen">Pen style used for rendering</param>
/// <param name="map">Map reference</param>
/// <param name="offset">Offset by which line will be moved to right</param>
public void DrawLineString(IGraphics g, ILineString line, Pen pen, Map map, float offset)
{
var points = line.TransformToImage(map);
if (points.Length > 1)
{
var gp = new GraphicsPath();
if (offset != 0d)
points = RendererHelper.OffsetRight(points, offset);
gp.AddLines(/*LimitValues(*/points/*, ExtremeValueLimit)*/);
g.DrawPath(pen, gp);
}
}
示例2: OnRenderInternal
/// <summary>
/// Method that does the actual rendering of individual features.
/// </summary>
/// <param name="map">The map</param>
/// <param name="lineString">The linestring</param>
/// <param name="graphics">The graphics object</param>
protected override void OnRenderInternal(Map map, ILineString lineString, Graphics graphics)
{
var pts = /*LimitValues(*/ VectorRenderer.OffsetRight(lineString.TransformToImage(map), Offset) /*)*/;
graphics.DrawLines(Line, pts);
}
示例3: LineStringToPath
/// <summary>
/// Function to transform a linestring to a graphics path for further processing
/// </summary>
/// <param name="lineString">The Linestring</param>
/// <param name="map">The map</param>
/// <!--<param name="useClipping">A value indicating whether clipping should be applied or not</param>-->
/// <returns>A GraphicsPath</returns>
public static GraphicsPath LineStringToPath(ILineString lineString, Map map)
{
var gp = new GraphicsPath(FillMode.Alternate);
gp.AddLines(lineString.TransformToImage(map));
return gp;
}
示例4: OnRenderInternal
/// <summary>
/// Function that actually renders the linestring
/// </summary>
/// <param name="map"></param>
/// <param name="lineString"></param>
/// <param name="graphics"></param>
protected override void OnRenderInternal(Map map, ILineString lineString, IGraphics graphics)
{
var gp = new GraphicsPath();
gp.AddLines(/*LimitValues(*/lineString.TransformToImage(map)/*)*/);
if (ImmediateMode)
{
var tmp = new List<GraphicsPath>(new[] {gp});
Symbolize(graphics, map, tmp);
}
else
_graphicsPaths.Add(gp);
}
示例5: LineStringToPath
//private static void WarpedLabel(MultiLineString line, ref BaseLabel baseLabel, Map map)
//{
// var path = MultiLineStringToPath(line, map, true);
// var pathLabel = new PathLabel(baseLabel.Text, path, 0f, baseLabel.Priority, new LabelBox(path.GetBounds()), baseLabel.Style);
// baseLabel = pathLabel;
//}
//private static void WarpedLabel(LineString line, ref BaseLabel baseLabel, Map map)
//{
// var path = LineStringToPath(line, map, false);
// var pathLabel = new PathLabel(baseLabel.Text, path, 0f, baseLabel.Priority, new LabelBox(path.GetBounds()), baseLabel.Style);
// baseLabel = pathLabel;
//}
/// <summary>
/// Function to transform a linestring to a graphics path for further processing
/// </summary>
/// <param name="lineString">The Linestring</param>
/// <param name="map">The map</param>
/// <!--<param name="useClipping">A value indicating whether clipping should be applied or not</param>-->
/// <returns>A GraphicsPath</returns>
public static GraphicsPath LineStringToPath(ILineString lineString, Map map/*, bool useClipping*/)
{
var gp = new GraphicsPath(FillMode.Alternate);
//if (!useClipping)
gp.AddLines(lineString.TransformToImage(map));
//else
//{
// var bb = map.Envelope;
// var cohenSutherlandLineClipping = new CohenSutherlandLineClipping(bb.Left, bb.Bottom, bb.Right, bb.Top);
// var clippedLineStrings = cohenSutherlandLineClipping.ClipLineString(lineString);
// foreach (var clippedLineString in clippedLineStrings.LineStrings)
// {
// var s = clippedLineString.StartPoint;
// var e = clippedLineString.EndPoint;
// var dx = e.X - s.X;
// //var dy = e.Y - s.Y;
// LineString revcls = null;
// if (dx < 0)
// revcls = ReverseLineString(clippedLineString);
// gp.StartFigure();
// gp.AddLines(revcls == null ? clippedLineString.TransformToImage(map) : revcls.TransformToImage(map));
// }
//}
return gp;
}