⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pfslideeffect.cs.svn-base

📁 这是一个windows mobile程序能够实现窗体运货效果非常不错
💻 SVN-BASE
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Aspecto.PocketFrog;
using System.Drawing;

namespace Aspecto.FlowFX
{
    public class PfSlideEffect : PocketFrogEffect
    {
        public override void Swap(FlowForm lastForm, FlowForm nextForm, bool opening)
        {
            base.Swap(lastForm, nextForm, opening);

            int multiplier = opening ? -1 : 1;
            Surface surface = TakeScreenShot(-lastForm.Bounds.Y);

            Surface surface2 = surface.Clone();

            Rect gr;
            if (opening)
                gr = new Rect(0, nextForm.Bounds.Y, surface2.Width, nextForm.Bounds.Y + nextForm.Height);
            else
                gr = new Rect(0, lastForm.Bounds.Y, surface2.Width, lastForm.Bounds.Y + lastForm.Height);

            Rasterizer rast = new Rasterizer(surface2);
            rast.FillRect(gr, PFUtility.RGB(nextForm.BackColor));

            display.GetBackBuffer();
            display.SetClipping(new Rect(0, 0, display.GetWidth(), display.GetHeight()));

            int frame = 1;

           // int FPSLastTime = Environment.TickCount;
           // int FPSTicksPerFrame = 1000 / 30;
            while (frame < Screen.PrimaryScreen.Bounds.Width)
            {
                //while (Environment.TickCount - FPSLastTime < FPSTicksPerFrame) { }
                //FPSLastTime = Environment.TickCount;

                display.GetBackBuffer();
                display.Blit(frame * multiplier, 0, surface, new Rect(0, 0, surface.Width, surface.Height));
                display.Blit((frame * multiplier) + (surface.Width * multiplier * -1), 0, surface2, new Rect(0, 0, surface2.Width, surface2.Height));
                display.Update();
                frame += Math.Max(1, (int)(Math.Abs(frame) * 0.4));
            }
            surface.Dispose();
            surface2.Dispose();
            DrawStartBar();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -