예제 #1
0
    public void PutForm_Initialize(Point _location, Bitmap _m_PageA, Bitmap _m_PageB, double transparency, int _AnimationSpeed, int _rotorType)
    {
        rotorType = _rotorType;

        m_PageA = _m_PageA;
        m_PageB = _m_PageB;
        m_X1    = 0;
        m_X2    = m_PageA.Width;
        m_Y1    = 0;
        m_Y2    = m_PageA.Height;

        c_X = 1;
        c_Y = 1;

        _transparency  = transparency;
        AnimationSpeed = _AnimationSpeed;

        Put_form = new PerPixelAlphaForm();
        Put_form.ShowInTaskbar = false;
        Put_form.ShowIcon      = false;
        Put_form.SetBitmap(m_PageA, (byte)_transparency);
        Put_form.Location = _location;
        Put_form.Show();

        Timer1          = new System.Windows.Forms.Timer();
        Timer1.Interval = 5;
        Timer1.Tick    += Timer1_Tick;
        Timer1.Enabled  = true;
    }
예제 #2
0
    private void chg_Half(int half)
    {
        PerPixelAlphaForm Put_form = new PerPixelAlphaForm();

        Put_form.ShowInTaskbar = false;
        Put_form.ShowIcon      = false;
        Put_form.Location      = Point.Round(set[0]);
        Put_form.SetBitmap(display[89 * half], (byte)_transparency);
        Put_form.Show();

        _formList[half].listForm.CrossThreadCalls(() =>
        {
            _formList[half].listForm.SetOpacity(0);
        });

        _BeginPeriod((uint)_speed);
        if (half == 0)
        {
            for (int i = 0; i < 90; i++)
            {
                Put_form.Location = Point.Round(set[i]);
                Put_form.SetBitmap(display[i], (byte)_transparency);
                Thread.Sleep(_speed);
            }
        }
        else
        if (half == 1)
        {
            for (int i = 89; i >= 0; i--)
            {
                Put_form.Location = Point.Round(set[i]);
                Put_form.SetBitmap(display[i], (byte)_transparency);
                Thread.Sleep(_speed);
            }
        }
        _EndPeriod((uint)_speed);

        int t = 0;

        if (half == 0)
        {
            t = 1;
        }
        _formList[t].listForm.CrossThreadCalls(() =>
        {
            _formList[t].listForm.SetOpacity(_transparency);
        });
    }
예제 #3
0
    // Token: 0x0600024C RID: 588 RVA: 0x01036604 File Offset: 0x01034804
    public void method_1(Bitmap bitmap_0, int int_4)
    {
        if (bitmap_0.PixelFormat != PixelFormat.Format32bppArgb)
        {
            throw new ApplicationException("The bitmap must be 32bpp with alpha-channel.");
        }
        IntPtr dc      = PerPixelAlphaForm.GetDC(IntPtr.Zero);
        IntPtr intPtr  = PerPixelAlphaForm.CreateCompatibleDC(dc);
        IntPtr intPtr2 = IntPtr.Zero;
        IntPtr intptr_ = IntPtr.Zero;

        try
        {
            intPtr2 = bitmap_0.GetHbitmap(Color.FromArgb(0));
            intptr_ = PerPixelAlphaForm.SelectObject(intPtr, intPtr2);
            PerPixelAlphaForm.Struct7 @struct = new PerPixelAlphaForm.Struct7(bitmap_0.Width, bitmap_0.Height);
            PerPixelAlphaForm.Struct6 struct2 = new PerPixelAlphaForm.Struct6(0, 0);
            PerPixelAlphaForm.Struct6 struct3 = new PerPixelAlphaForm.Struct6(base.Left, base.Top);
            PerPixelAlphaForm.Struct9 struct4 = default(PerPixelAlphaForm.Struct9);
            struct4.byte_0 = 0;
            struct4.byte_1 = 0;
            struct4.byte_2 = (byte)int_4;
            struct4.byte_3 = 1;
            PerPixelAlphaForm.UpdateLayeredWindow(this.method_3(), dc, ref struct3, ref @struct, intPtr, ref struct2, 0, ref struct4, 2);
        }
        finally
        {
            PerPixelAlphaForm.ReleaseDC(IntPtr.Zero, dc);
            if (intPtr2 != IntPtr.Zero)
            {
                PerPixelAlphaForm.SelectObject(intPtr, intptr_);
                PerPixelAlphaForm.DeleteObject(intPtr2);
            }
            PerPixelAlphaForm.DeleteDC(intPtr);
        }
    }
예제 #4
0
    public void Initialize3dEffect(Point origin, int _first, int _second, int rotationType, double transparency, int speed)
    {
        Thread check_all = new Thread(ck_All);

        check_all.Start();

        Bitmap firstBmp  = _formList[_first].listImg;
        Bitmap secondBmp = _formList[_second].listImg;

        _w = _formList[_first].listImg.Width;
        _h = _formList[_first].listImg.Height;

        Put_form = new PerPixelAlphaForm();
        Put_form.ShowInTaskbar = false;
        Put_form.ShowIcon      = false;
        _rotationtype          = rotationType;
        _speed        = speed;
        _transparency = transparency * 255;

        cube = new Cube(firstBmp.Width, firstBmp.Height, 1);
        for (int i = 0; i < 90; i++)
        {
            cube.RotateY = i * 2;
            cube.calcCube(origin);
            corners[i, 0] = cube.d;
            corners[i, 1] = cube.a;
            corners[i, 2] = cube.c;
            corners[i, 3] = cube.b;
            int t = 0;
            if ((corners[i, 0].X - corners[i, 1].X) <= 1)
            {
                if (corners[i, 0].Y < corners[i, 1].Y)
                {
                    t = corners[i, 0].Y;
                }
                else
                {
                    t = corners[i, 1].Y;
                }
                set[i] = new PointF(corners[i, 0].X + _w / 2, t + _h / 2);
            }
            else
            {
                if (corners[i, 1].Y < corners[i, 0].Y)
                {
                    t = corners[i, 1].Y;
                }
                else
                {
                    t = corners[i, 0].Y;
                }
                set[i] = new PointF(corners[i, 1].X + _w / 2, t + _h / 2);
            }
            begin[i]   = false;
            filters[i] = new FreeTransform();
            if (i < 45)
            {
                filters[i].Bitmap = firstBmp;
            }
            else
            {
                filters[i].Bitmap = secondBmp;
            }
        }
        for (int i = 0; i < 90; i++)
        {
            rtd[i] = new Thread(getimg);
            rtd[i].Start(i);
        }
    }
예제 #5
0
        void UpdateAlphaPreviewWindow( bool allowOn=true )
        {
            // Prevent it from reentering here (when we call _alphaPreviewForm.Show below) and screwing everything up.
            if ( _updatingAlphaPreviewWindow )
                return;

            _updatingAlphaPreviewWindow = true;

            bool on = _alphaPreviewCheckbox.Checked && allowOn;

            if ( on )
            {
                if ( _alphaPreviewForm == null )
                {
                    _alphaPreviewForm = new PerPixelAlphaForm();
                    _alphaPreviewForm.ShowInTaskbar = false;
                }

                _alphaPreviewForm.SetBitmap( _fontPreviewBitmap );
                _alphaPreviewForm.Show();

                // Reposition it.
                _alphaPreviewForm.Left = this.Right + 10;
                _alphaPreviewForm.Top = this.Top + _fontPreview.Top + ( this.Size.Height - this.ClientSize.Height );
            }
            else
            {
                if ( _alphaPreviewForm != null )
                {
                    _alphaPreviewForm.Close();
                    _alphaPreviewForm = null;
                }
            }

            _updatingAlphaPreviewWindow = false;
        }