pocketfrogeffect.cs.svn-base

来自「这是一个windows mobile程序能够实现窗体运货效果非常不错」· SVN-BASE 代码 · 共 59 行

SVN-BASE
59
字号
using System;
using System.Collections.Generic;
using System.Text;
using Aspecto.PocketFrog;
using System.Windows.Forms;
using System.Drawing;
using System.Runtime.InteropServices;
using Microsoft.WindowsCE.Forms;

namespace Aspecto.FlowFX
{
    public class PocketFrogEffect : Effect
    {
        protected static Display display;
        private static ScreenOrientation lastOrientation;

        private void initialise(Form f)
        {
            if (display == null || lastOrientation != SystemSettings.ScreenOrientation) // CW is 270
            {
                if (display != null)
                    display.Dispose();
                lastOrientation = SystemSettings.ScreenOrientation;
                DisplayParameters dp = new DisplayParameters((DisplayOrientation)lastOrientation, SwapEffect.SWAP_DISCARD);
                display = Display.Create(new Control(), dp);
                GXCloseInput();
            }
        }

        [DllImport("gx.dll",EntryPoint="?GXCloseInput@@YAHXZ")]
        private static extern int GXCloseInput();


        protected Surface TakeScreenShot(int offset)
        {
            int w = Screen.PrimaryScreen.Bounds.Width;
            int h = Screen.PrimaryScreen.Bounds.Height;

            Surface surface = new Surface(w, h);//TakeScreenShot(-lastForm.Bounds.Y);
            IntPtr dc = surface.GetDC(false);

            IntPtr screenWnd = DrawingWrapper.GetForegroundWindow();
            IntPtr dc1 = DrawingWrapper.GetDC(screenWnd);

            DrawingWrapper.StretchBlt(dc, 0, 0, w, h, dc1, 0, offset, w, h, DrawingWrapper.SRCCOPY);

            surface.ReleaseDC(dc);
            DrawingWrapper.ReleaseDC(screenWnd, dc1);
            return surface;
        }

        public override void Swap(FlowForm lastForm, FlowForm nextForm, bool opening)
        {
            base.Swap(lastForm, nextForm, opening);
            initialise(lastForm);
        }
    }
}

⌨️ 快捷键说明

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