想在屏幕上画100条直线请问有什么方法(有点像标尺)?只能循环一条一条画吗?
有没有能一次画出一百条直线的
因为是放在Timer中执行!执行一次要画一百次CPU占的有点高
求高人给指条明路
代码如下
for (int i = 1; i <= 100; i++)
{
widthStart += widthStep;
if (i % 10 == 0) { Pe = new Pen(Color.Red, 1); startLocationY = 370; endLocationY = 385; }
else if (i % 5 == 0) { Pe = new Pen(Color.Gold, 1); startLocationY = 372; endLocationY = 383; }
else { Pe = new Pen(Color.Olive, 1); startLocationY = 376; endLocationY = 377; }
G.DrawLine(Pe, widthStart, startLocationY, widthStart, endLocationY);//画竖线
}
有没有能一次画出一百条直线的
因为是放在Timer中执行!执行一次要画一百次CPU占的有点高
求高人给指条明路
代码如下
for (int i = 1; i <= 100; i++)
{
widthStart += widthStep;
if (i % 10 == 0) { Pe = new Pen(Color.Red, 1); startLocationY = 370; endLocationY = 385; }
else if (i % 5 == 0) { Pe = new Pen(Color.Gold, 1); startLocationY = 372; endLocationY = 383; }
else { Pe = new Pen(Color.Olive, 1); startLocationY = 376; endLocationY = 377; }
G.DrawLine(Pe, widthStart, startLocationY, widthStart, endLocationY);//画竖线
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货