找传奇、传世资源到传世资源站!

界面切换特效封装类

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

public class InterfaceDesgin //界面设计类 { [System.Runtime.InteropServices.DllImport("user32")] private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int Flags); private const int AW_HOR_POSITIVE = 0x0001; private const int AW_HOR_NEGATIVE = 0x0002; private const int AW_VER_POSITIVE = 0x0004; private const int AW_VER_NEGATIVE = 0x0008; private const int AW_CENTER = 0x0010; private const int AW_HIDE = 0x10000; private const int AW_ACTIVATE = 0x20000; private const int AW_SLIDE = 0x40000; private const int AW_BLEND = 0x80000; private int CloseOpen = 0x20000; public InterfaceDesgin(IntPtr hwnd, int Flags) { try { switch (Flags) { case 1: AnimateWindow(hwnd, 500, AW_HOR_POSITIVE); break; //从左向右显示 case 2: AnimateWindow(hwnd, 400, AW_VER_POSITIVE); break; //从上到下显示 case 3: AnimateWindow(hwnd, 630, AW_HOR_POSITIVE | AW_HIDE); break;//从左向右隐藏 case 4: AnimateWindow(hwnd, 1600, AW_CENTER | AW_HIDE); break;//从中间向四周隐 case 5: AnimateWindow(hwnd, 470, AW_VER_NEGATIVE | AW_HIDE); break;//从下到上隐藏 case 6: AnimateWindow(hwnd, 800, AW_CENTER | CloseOpen); break;//从中间向四周 } } catch { } } public GraphicsPath GetRoundRectPath(RectangleF rect, float radius) { return GetRoundRectPath(rect.X, rect.Y, rect.Width, rect.Height, radius); } public GraphicsPath GetRoundRectPath(float X, float Y, float width, float height, float radius) { GraphicsPath path = new GraphicsPath(); path.AddLine(X radius, Y, (X width) - (radius * 2f), Y); path.AddArc((X width) - (radius * 2f), Y, radius * 2f, radius * 2f, 270f, 90f); path.AddLine((float)(X width), (float)(Y radius), (float)(X width), (float)((Y height) - (radius * 2f))); path.AddArc((float)((X width) - (radius * 2f)), (float)((Y height) - (radius * 2f)), (float)(radius * 2f), (float)(radius * 2f), 0f, 90f); path.AddLine((float)((X width) - (radius * 2f)), (float)(Y height), (float)(X radius), (float)(Y height)); path.AddArc(X, (Y height) - (radius * 2f), radius * 2f, radius * 2f, 90f, 90f); path.AddLine(X, (Y height) - (radius * 2f), X, Y radius); path.AddArc(X, Y, radius * 2f, radius * 2f, 180f, 90f); path.CloseFigure(); return path; } }

界面切换特效封装类 C#语言基础-第1张

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复