📄 draw_tools.cs
字号:
namespace Imps.Client.Pc.BizControls
{
using System;
using System.Drawing;
public class draw_tools
{
public static void draw_check_flag(Graphics g, Rectangle rect, Color color)
{
int num = rect.Left + ((rect.Width - 8) / 2);
int num2 = rect.Top + ((rect.Height - 8) / 2);
using (Brush brush = new SolidBrush(color))
{
for (int i = 0; i < 3; i++)
{
g.FillRectangle(brush, (num + 2) - i, ((num2 + 7) - i) - 2, 1, 1);
g.FillRectangle(brush, (num + 2) - i, ((num2 + 7) - i) - 1, 1, 1);
g.FillRectangle(brush, (num + 2) - i, (num2 + 7) - i, 1, 1);
}
for (int j = 3; j < 8; j++)
{
g.FillRectangle(brush, num + j, (num2 + 7) - j, 1, 1);
g.FillRectangle(brush, num + j, ((num2 + 7) - j) + 1, 1, 1);
g.FillRectangle(brush, num + j, ((num2 + 7) - j) + 2, 1, 1);
}
}
}
public static void draw_radio_flag(Graphics g, Rectangle rect, Color color)
{
int x = rect.Left + ((rect.Width - 7) / 2);
int y = rect.Top + ((rect.Height - 7) / 2);
using (Brush brush = new SolidBrush(color))
{
g.FillEllipse(brush, x, y, 7, 7);
}
using (Pen pen = new Pen(color))
{
g.DrawEllipse(pen, x, y, 7, 7);
}
}
public static void draw_simple_arrow(Graphics g, int nLeft, int nTop, int nWidth, Color color, arrow_type direction)
{
if (0 < nWidth)
{
using (Brush brush = new SolidBrush(color))
{
int x;
int num3;
int num5;
int num7;
switch (direction)
{
case arrow_type.left:
goto Label_0059;
case arrow_type.top:
goto Label_008E;
case arrow_type.right:
goto Label_00C5;
case arrow_type.bottom:
goto Label_00FC;
default:
return;
}
Label_002F:
x = nLeft;
for (int i = nTop; i < (nTop + nWidth); i++)
{
g.FillRectangle(brush, x, i, 1, 1);
}
nWidth -= 2;
nLeft--;
nTop++;
Label_0059:
if (nWidth > 0)
{
goto Label_002F;
}
return;
Label_0062:
num3 = nLeft;
int y = nTop;
while (num3 < (nLeft + nWidth))
{
g.FillRectangle(brush, num3, y, 1, 1);
num3++;
}
nWidth -= 2;
nLeft++;
nTop--;
Label_008E:
if (nWidth > 0)
{
goto Label_0062;
}
return;
Label_0094:
num5 = nLeft;
for (int j = nTop; j < (nTop + nWidth); j++)
{
g.FillRectangle(brush, num5, j, 1, 1);
}
nWidth -= 2;
nLeft++;
nTop++;
Label_00C5:
if (nWidth > 0)
{
goto Label_0094;
}
return;
Label_00CB:
num7 = nLeft;
int num8 = nTop;
while (num7 < (nLeft + nWidth))
{
g.FillRectangle(brush, num7, num8, 1, 1);
num7++;
}
nWidth -= 2;
nLeft++;
nTop++;
Label_00FC:
if (nWidth > 0)
{
goto Label_00CB;
}
}
}
}
public enum arrow_type
{
bottom = 4,
left = 1,
right = 3,
top = 2
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -