在C#中怎么实现中国蚂蚁论坛线

C#绘制蚂蚁线_.NET教程_编程技术
您的位置: &
& C#绘制蚂蚁线
delegate void LINEDDAPROC(int X, int Y, IntPtr lpData);[DllImport("gdi32.dll")]static extern int LineDDA(int nXStart, int nYStart, int nXEnd, int nYEnd,&&& LINEDDAPROC lpLineFunc, IntPtr lpData);&private const byte PT_CLOSEFIGURE = 1;private const byte PT_LINETO = 2;private const byte PT_BEZIERTO = 4;private const byte PT_MOVETO = 6;&[DllImport("gdi32.dll")]static extern int SetPixel(IntPtr hdc, int X, int Y, int crColor);&GraphicsPath graphicsPath = new GraphicsPath();private int counter = 0;private IntPtr graphicsHandle = IntPtr.Z//设计Zswang
尊重作者,转贴请注明出处&private void button1_Click(object sender, EventArgs e){&&& graphicsPath.ClearMarkers();&&& graphicsPath.AddRectangle(new Rectangle(10, 10, 100, 100));&&& timer1.Interval = 100;&&& timer1.Enabled =}&private void MovingDots(int X, int Y, IntPtr lpData){&&& counter = (counter + 1) % 15;&&& Color vC&&& if (counter & 5)&&&&&&& vColor = Color.W&&& else if (counter & 12)&&&&&&& vColor = Color.R&&& else vColor = Color.B&&& SetPixel(graphicsHandle, X, Y, vColor.R | vColor.G && 8 | vColor.B && 16);}&private void timer1_Tick(object sender, EventArgs e){&&& graphicsHandle = Graphics.FromHwnd(Handle).GetHdc();&&& for (int i = 0; i & graphicsPath.PathPoints.L i++)&&& {&&&&&&& if (graphicsPath.PathTypes[i] == (byte)(PT_CLOSEFIGURE | PT_LINETO))&&&&&&& {&&&&&&&&&&& for (int j = j &= 0; j--)&&&&&&&&&&& {&&&&&&&&&&&&&&& if (graphicsPath.PathTypes[j] == PT_MOVETO)&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&& LineDDA(&&&&&&&&&&&&&&&&&&&&&&& (int)graphicsPath.PathPoints[i].X,&&&&&&&&&&&&&&&&&&&&&&& (int)graphicsPath.PathPoints[i].Y,&&&&&&&&&&&&&&&&&&&&&&& (int)graphicsPath.PathPoints[j].X,&&&&&&&&&&&&&&&&&&&&&&& (int)graphicsPath.PathPoints[j].Y,&&&&&&&&&&&&&&&&&&&&&&& MovingDots, IntPtr.Zero);&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&& }&&&&&&&&&&&&&&&&&& }&&&&&&& if (i == graphicsPath.PathPoints.Length - 1)&&&&&&&&&&& LineDDA(&&&&&&&&&&&&&&& (int)graphicsPath.PathPoints[i].X,&&&&&&&&&&&&&&& (int)graphicsPath.PathPoints[i].Y,&&&&&&&&&&&&&&& (int)graphicsPath.PathPoints[0].X,&&&&&&&&&&&&&&& (int)graphicsPath.PathPoints[0].Y,&&&&&&&&&&&&&&& MovingDots, IntPtr.Zero);&&&&&&& else&&&&&&&&&&& LineDDA(&&&&&&&&&&&&&&& (int)graphicsPath.PathPoints[i].X,&&&&&&&&&&&&&&& (int)graphicsPath.PathPoints[i].Y,&&&&&&&&&&&&&&& (int)graphicsPath.PathPoints[i + 1].X,&&&&&&&&&&&&&&& (int)graphicsPath.PathPoints[i + 1].Y,&&&&&&&&&&&&&&& MovingDots, IntPtr.Zero);&&& }}&
相关排行总榜 上传我的文档
 下载
 收藏
该文档贡献者很忙,什么也没留下。
 下载此文档
正在努力加载中...
多点触摸概述与手势实现
下载积分:1500
内容提示:多点触摸概述与手势实现
文档格式:PDF|
浏览次数:0|
上传日期: 16:15:58|
文档星级:
该用户还上传了这些文档
多点触摸概述与手势实现.PDF
官方公共微信}

我要回帖

更多关于 上海白蚂蚁防治中心 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信