文件来源http://www.softpedia.com/get/Programming/ ... g-Files/Convert-NET.shtml
ConvertNet 8.8
https://fishcodelib.com/Convert.htm
https://converter.telerik.com/
internal void Render(Graphics graphics)
{
m_quadTree.ForEach(delegate(QuadTreeNode<Item> node)
{
// draw the contents of this quad
if (node.Contents != null)
{
foreach (Item item in node.Contents)
{
using (Brush b = new SolidBrush(item.Color))
graphics.FillEllipse(b, Rectangle.Round(item.Rectangle));
}
}
// draw this quad
// Draw the border
Color color = GetColor(node);
graphics.DrawRectangle(Pens.Black, Rectangle.Round(node.Bounds));
// draw the inside of the border in a distinct colour
using (Pen p = new Pen(color))
{
Rectangle inside = Rectangle.Round(node.Bounds);
inside.Inflate(-1, -1);
graphics.DrawRectangle(p, inside);
}
});
}
Friend Sub Render(ByVal graphics As Graphics)
' draw the contents of this quad
' draw this quad
' Draw the border
' draw the inside of the border in a distinct colour
m_quadTree.ForEach((Sub(node As QuadTreeNode(Of Item))
If node.Contents IsNot Nothing Then
For Each current As Item In node.Contents
Using brush As Brush = New SolidBrush(current.Color)
graphics.FillEllipse(brush, Rectangle.Round(current.Rectangle))
End Using
Next
End If
Dim color As Color = Me.GetColor(node)
graphics.DrawRectangle(Pens.Black, Rectangle.Round(node.Bounds))
Using pen As Pen = New Pen(color)
Dim rect As Rectangle = Rectangle.Round(node.Bounds)
rect.Inflate(-1, -1)
graphics.DrawRectangle(pen, rect)
End Using
End Sub))
End Sub
delegate to sub
[本日志由 tiancao1001 于 2024-04-09 11:03 AM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |