Exemplo n.º 1
0
        /// <summary>
        ///     派生クラスでこのメソッドをオーバーライドし、アイキャッチ画面の描画を行う。
        /// </summary>
        protected virtual void 進行描画する(DeviceContext dc, StoryboardStatus 描画しないStatus)
        {
            bool すべて完了 = true;

            // 派生クラスでは、ここで以下の(1)~(3)を実装すること。

            // (1) ストーリーボードが動作しているなら、すべて完了 フラグを false にする。
            //     例:
            //      if( context.ストーリーボード.Status != StoryboardStatus.Ready )
            //	        すべて完了 = false;

            // (2) アイキャッチ画面を描画する。
            //     ただし、現在のストーリーボードのステータスが 描画しないStatus であるなら、描画はしないこと。
            //     例:
            //          if( context.ストーリーボード.Status != 描画しないStatus )
            //          {
            //              // 描画処理
            //          }

            // (3) すべて完了したかどうかチェックする。
            if (すべて完了)
            {
                if (this.現在のフェーズ == フェーズ.クローズ)
                {
                    this.現在のフェーズ = フェーズ.クローズ完了;
                }
                else if (this.現在のフェーズ == フェーズ.オープン)
                {
                    this.現在のフェーズ = フェーズ.オープン完了;
                }
            }
        }
        protected virtual void 進行描画する(グラフィックデバイス gd, StoryboardStatus 描画しないStatus)
        {
            bool すべて完了 = true;

            // ストーリーボードが動作しているなら、すべて完了 フラグを切る。
            //if( context.ストーリーボード.Status != StoryboardStatus.Ready )
            //	すべて完了 = false;

            // 描画するステータスなら描画する。
            //if( context.ストーリーボード.Status != 描画しないStatus )
            //{
            //   ...
            //}

            if (すべて完了)
            {
                if (this.現在のフェーズ == フェーズ.クローズ)
                {
                    this.現在のフェーズ = フェーズ.クローズ完了;
                }
                else if (this.現在のフェーズ == フェーズ.オープン)
                {
                    this.現在のフェーズ = フェーズ.オープン完了;
                }
            }
        }
        // 進行と描画


        /// <summary>
        ///     アイキャッチのアニメーションを進行し、アイキャッチ画像を描画する。
        /// </summary>
        protected override void 進行描画する(DeviceContext dc, StoryboardStatus 描画しないStatus)
        {
            bool すべて完了 = true;

            switch (this.現在のフェーズ)
            {
            case フェーズ.クローズ:
                #region " *** "
                //----------------
                if (this._アニメーション.ストーリーボード.Status != StoryboardStatus.Ready)
                {
                    すべて完了 = false;
                }

                if (this._アニメーション.ストーリーボード.Status != 描画しないStatus)
                {
                    DXResources.Instance.D2DBatchDraw(dc, () => {
                        var pretrans = dc.Transform;

                        #region " 背景マスク "
                        //----------------
                        using (var ブラシ = new SolidColorBrush(dc, new Color4(Color3.Black, (float)this._アニメーション.背景_不透明度.Value)))
                        {
                            dc.FillRectangle(new RectangleF(0f, 0f, DXResources.Instance.設計画面サイズ.Width, DXResources.Instance.設計画面サイズ.Width), ブラシ);
                        }
                        //----------------
                        #endregion
                        #region " (2) 黒幕1(左下)"
                        //----------------
                        {
                            float w = DXResources.Instance.設計画面サイズ.Width * 1.5f;
                            float h = DXResources.Instance.設計画面サイズ.Height;
                            var rc  = new RectangleF(-w / 2f, -h / 2f, w, h);

                            dc.Transform =
                                Matrix3x2.Rotation(     // 上辺中央を中心として回転
                                    angle: (float)this._アニメーション.黒幕1左下_回転角rad.Value,
                                    center: new Vector2(0f, -rc.Height / 2f)) *
                                Matrix3x2.Translation(      // (基点X, H×3/4) へ移動
                                    x: (float)this._アニメーション.黒幕1左下_基点位置X.Value,
                                    y: DXResources.Instance.設計画面サイズ.Height) *
                                pretrans;

                            dc.FillRectangle(rc, this._黒ブラシ);
                        }
                        //----------------
                        #endregion
                        #region " (3) 黒幕2(右上)"
                        //----------------
                        {
                            float w = DXResources.Instance.設計画面サイズ.Width * 1.5f;
                            float h = DXResources.Instance.設計画面サイズ.Height;
                            var rc  = new RectangleF(-w / 2f, -h / 2f, w, h);

                            dc.Transform =
                                Matrix3x2.Rotation(     // 下辺中央を中心として回転
                                    angle: (float)this._アニメーション.黒幕2右上_回転角rad.Value,
                                    center: new Vector2(0f, rc.Height / 2f)) *
                                Matrix3x2.Translation(      // (基点X, H×1/4) へ移動
                                    x: (float)this._アニメーション.黒幕2右上_基点位置X.Value,
                                    y: 0f) *
                                pretrans;

                            dc.FillRectangle(rc, this._黒ブラシ);
                        }
                        //----------------
                        #endregion
                        #region " (4) ロゴ "
                        //----------------
                        dc.Transform =
                            Matrix3x2.Scaling(639f / this._ロゴ画像.サイズ.Width, 262f / this._ロゴ画像.サイズ.Height) *
                            Matrix3x2.Translation((float)this._アニメーション.ロゴ_位置X.Value, 771f) *
                            pretrans;

                        dc.DrawBitmap(this._ロゴ画像.Bitmap, (float)this._アニメーション.ロゴ_不透明度.Value, BitmapInterpolationMode.Linear);
                        //----------------
                        #endregion
                    });
                }
                //----------------
                #endregion
                break;

            case フェーズ.クローズ完了:
                break;

            case フェーズ.オープン:
                #region " *** "
                //----------------
                if (this._アニメーション.ストーリーボード.Status != StoryboardStatus.Ready)
                {
                    すべて完了 = false;
                }

                if (this._アニメーション.ストーリーボード.Status != 描画しないStatus)
                {
                    DXResources.Instance.D2DBatchDraw(dc, () => {
                        var pretrans = dc.Transform;

                        #region " (1) 背景マスク "
                        //----------------
                        using (var ブラシ = new SolidColorBrush(dc, new Color4(Color3.Black, (float)this._アニメーション.背景_不透明度.Value)))
                        {
                            dc.FillRectangle(new RectangleF(0f, 0f, DXResources.Instance.設計画面サイズ.Width, DXResources.Instance.設計画面サイズ.Width), ブラシ);
                        }
                        //----------------
                        #endregion
                        #region " (2) 黒幕1(左下)"
                        //----------------
                        {
                            float w = DXResources.Instance.設計画面サイズ.Width * 1.5f;
                            float h = DXResources.Instance.設計画面サイズ.Height;
                            var rc  = new RectangleF(-w / 2f, -h / 2f, w, h);

                            dc.Transform =
                                Matrix3x2.Rotation(     // 上辺中央を中心として回転
                                    angle: (float)this._アニメーション.黒幕1左下_回転角rad.Value,
                                    center: new Vector2(0f, -rc.Height / 2f)) *
                                Matrix3x2.Translation(      // (基点X, H×3/4) へ移動
                                    x: (float)this._アニメーション.黒幕1左下_基点位置X.Value,
                                    y: DXResources.Instance.設計画面サイズ.Height) *
                                pretrans;

                            dc.FillRectangle(rc, this._黒ブラシ);
                        }
                        //----------------
                        #endregion
                        #region " (3) 黒幕2(右上)"
                        //----------------
                        {
                            float w = DXResources.Instance.設計画面サイズ.Width * 1.5f;
                            float h = DXResources.Instance.設計画面サイズ.Height;
                            var rc  = new RectangleF(-w / 2f, -h / 2f, w, h);

                            dc.Transform =
                                Matrix3x2.Rotation(     // 下辺中央を中心として回転
                                    angle: (float)this._アニメーション.黒幕2右上_回転角rad.Value,
                                    center: new Vector2(0f, rc.Height / 2f)) *
                                Matrix3x2.Translation(      // (基点X, H×1/4) へ移動
                                    x: (float)this._アニメーション.黒幕2右上_基点位置X.Value,
                                    y: 0f) *
                                pretrans;

                            dc.FillRectangle(rc, this._黒ブラシ);
                        }
                        //----------------
                        #endregion
                        #region " (4) ロゴ "
                        //----------------
                        dc.Transform =
                            Matrix3x2.Scaling(639f / this._ロゴ画像.サイズ.Width, 262f / this._ロゴ画像.サイズ.Height) *
                            Matrix3x2.Translation((float)this._アニメーション.ロゴ_位置X.Value, 771f) *
                            pretrans;

                        dc.DrawBitmap(this._ロゴ画像.Bitmap, (float)this._アニメーション.ロゴ_不透明度.Value, BitmapInterpolationMode.Linear);
                        //----------------
                        #endregion
                    });
                }
                //----------------
                #endregion
                break;

            case フェーズ.オープン完了:
                break;
            }

            if (すべて完了)
            {
                if (this.現在のフェーズ == フェーズ.クローズ)
                {
                    this.現在のフェーズ = フェーズ.クローズ完了;
                }
                else if (this.現在のフェーズ == フェーズ.オープン)
                {
                    this.現在のフェーズ = フェーズ.オープン完了;
                }
            }
        }
Exemplo n.º 4
0
        // 進行と描画


        /// <summary>
        ///     アイキャッチのアニメーションを進行し、アイキャッチ画像を描画する。
        /// </summary>
        protected override void 進行描画する(DeviceContext dc, StoryboardStatus 描画しないStatus)
        {
            bool すべて完了 = true;

            #region " 背景の画像 "
            //----------------
            switch (this.現在のフェーズ)
            {
            case フェーズ.クローズ:
            {
                if (this._初めての進行描画)
                {
                    this._画面BC_アイキャッチ遷移画面1_回転中.ぼかしと縮小を解除する(0.0);            // 全部解除してから
                    this._画面BC_アイキャッチ遷移画面1_回転中.ぼかしと縮小を適用する();               // ゆっくり適用開始。

                    this._初めての進行描画 = false;
                }

                switch (this._クローズ割合.Value)             // 0 → 3.0
                {
                // 画面A(切り替え元画面)
                // 画面B(アイキャッチ遷移画面1(回転中))
                // 画面C(アイキャッチ画面)
                // ※ このメソッドの呼び出し前に、画面Aが全面描画済みであるものと想定する。

                case double 割合 when(1.0 > 割合):
                    #region " シーン1. 画面Aを下絵に、上下端から画面Bの描画領域が増えていく。(上下の黒帯の移動に伴って)"
                    //----------------
                    Size2F 画面Bサイズ = this._画面BC_アイキャッチ遷移画面1_回転中.サイズ;

                    float 画面B表示縦幅 = (float)(画面Bサイズ.Height * 割合 / 2.0);                   // 0 → height/2

                    // 上から
                    this._画面BC_アイキャッチ遷移画面1_回転中.進行描画する(dc, false, new Vector4(0f, 0f, 画面Bサイズ.Width, 画面B表示縦幅));

                    // 下から
                    this._画面BC_アイキャッチ遷移画面1_回転中.進行描画する(dc, false, new Vector4(0f, 画面Bサイズ.Height - 画面B表示縦幅, 画面Bサイズ.Width, 画面Bサイズ.Height));
                    //----------------
                    #endregion
                    break;

                case double 割合 when(2.0 > 割合):
                    #region " シーン2. 画面Bを全表示。(黒帯は回転中)"
                    //----------------
                    this._画面BC_アイキャッチ遷移画面1_回転中.進行描画する(dc);

                    //----------------
                    #endregion
                    break;

                case double 割合:             // default
                    #region " シーン3. 画面Bを下絵に、中央から左右に向かって(黒帯の移動に従って)、画面Cの描画領域が広くなっていく。"
                    //----------------
                    this._画面BC_アイキャッチ遷移画面1_回転中.進行描画する(dc);                  // 下絵の画面B、全表示。

                    // 以下、画面Cを上に重ねて描画。

                    割合 = 割合 - 2.0;              // 0 → 1.0

                    this._斜めレイヤーパラメータ.MaskTransform =
                        Matrix3x2.Scaling((float)(割合 * 0.5), 1.0f) *                     // x:0 → 0.5
                        ((割合 < 0.5) ?
                         Matrix3x2.Rotation((float)(Math.PI / (5.85 - 1.85 * (割合 * 2)))) :
                         Matrix3x2.Rotation((float)(Math.PI / 4.0))                                       // 45°
                        ) *
                        Matrix3x2.Translation(Global.設計画面サイズ.Width / 2.0f, Global.設計画面サイズ.Height / 2.0f); // 画面中央固定。

                    this._画面BC_アイキャッチ遷移画面1_回転中.進行描画する(dc, layerParameters1: this._斜めレイヤーパラメータ);
                    this._ロゴを描画する(dc);
                    //----------------
                    #endregion
                    break;
                }
            }
            break;

            case フェーズ.クローズ完了:
            {
                // 画面C(アイキャッチ画面(背景+ロゴ))
                this._画面BC_アイキャッチ遷移画面1_回転中.進行描画する(dc);
                this._ロゴを描画する(dc);
            }
            break;

            case フェーズ.オープン:
            {
                if (this._初めての進行描画)
                {
                    this._画面BC_アイキャッチ遷移画面1_回転中.ぼかしと縮小を適用する(0.0);               // 0.0秒以内 → 最初から全部適用状態。

                    this._画面D_アイキャッチ遷移画面2_逆回転中.ぼかしと縮小を適用する(0.0);               // 全部適用してから
                    this._画面D_アイキャッチ遷移画面2_逆回転中.ぼかしと縮小を解除する();                  // ゆっくり解除開始。

                    this._初めての進行描画 = false;
                }

                switch (this._クローズ割合.Value)             // 3.0 → 0
                {
                // 画面C(アイキャッチ画面)
                // 画面D(アイキャッチ遷移画面2(逆回転中))
                // 画面E(切り替え先画面)
                // ※ このメソッドの呼び出し前に、画面Eが全面描画済みであるものと想定する。

                case double 割合 when(2.0 < 割合):
                    #region " シーン3. 画面Cを下絵に、左右から中央に向かって(黒帯の移動に従って)、画面Dの描画領域が広くなっていく。"
                    //----------------
                    this._画面D_アイキャッチ遷移画面2_逆回転中.進行描画する(dc);                  // 画面D、全表示。(画面Cじゃないので注意)

                    // 以下、画面C(画面Dじゃないので注意)を左右の黒帯の間に描画。

                    割合 = 割合 - 2.0;              // 1.0 → 0

                    this._斜めレイヤーパラメータ.MaskTransform =
                        Matrix3x2.Scaling((float)(割合 * 0.5), 1.0f) *                     // x:0.5 → 0
                        ((割合 < 0.5) ?
                         Matrix3x2.Rotation((float)(Math.PI / (5.85 - 1.85 * (割合 * 2)))) :
                         Matrix3x2.Rotation((float)(Math.PI / 4.0))                                       // 45°
                        ) *
                        Matrix3x2.Translation(Global.設計画面サイズ.Width / 2.0f, Global.設計画面サイズ.Height / 2.0f); // 画面中央固定。

                    this._画面BC_アイキャッチ遷移画面1_回転中.進行描画する(dc, layerParameters1: this._斜めレイヤーパラメータ);
                    this._ロゴを描画する(dc);
                    //----------------
                    #endregion
                    break;

                case double 割合 when(1.0 < 割合):
                    #region " シーン2. 画面Dを全表示。(黒帯は逆回転中)"
                    //----------------
                    this._画面D_アイキャッチ遷移画面2_逆回転中.進行描画する(dc);

                    //----------------
                    #endregion
                    break;

                case double 割合:             // default
                    #region " シーン1. 画面Dを下絵に、中央から上下端に向かって(黒帯の移動に従って)、画面Eの描画領域が減っていく。"
                    //----------------
                    Size2F 画面Dサイズ  = this._画面D_アイキャッチ遷移画面2_逆回転中.サイズ;
                    float  画面D表示縦幅 = (float)(画面Dサイズ.Height * 割合 / 2.0);                  // height/2 → 0

                    // 上から
                    this._画面D_アイキャッチ遷移画面2_逆回転中.進行描画する(dc, false, new Vector4(0f, 0f, 画面Dサイズ.Width, 画面D表示縦幅));

                    // 下から
                    this._画面D_アイキャッチ遷移画面2_逆回転中.進行描画する(dc, false, new Vector4(0f, 画面Dサイズ.Height - 画面D表示縦幅, 画面Dサイズ.Width, 画面Dサイズ.Height));
                    //----------------
                    #endregion
                    break;
                }
            }
            break;

            case フェーズ.オープン完了:
            {
                // 画面E(切り替え先画面、すでに描画済みと想定)
            }
            break;
            }
            //----------------
            #endregion

            #region " 黒帯(全シーンで共通)"
            //----------------
            Global.D2DBatchDraw(dc, () => {
                var pretrans = dc.Transform;

                for (int i = 0; i < 2; i++)
                {
                    var context = this._黒幕アニメーション[i];

                    if (context.ストーリーボード.Status != StoryboardStatus.Ready)
                    {
                        すべて完了 = false;
                    }

                    if (context.ストーリーボード.Status == 描画しないStatus)
                    {
                        continue;
                    }

                    dc.Transform =
                        Matrix3x2.Rotation((float)context.回転角rad.Value) *
                        Matrix3x2.Translation((float)context.中心位置X.Value, (float)context.中心位置Y.Value) *
                        pretrans;

                    using (var brush = new SolidColorBrush(dc, new Color4(0f, 0f, 0f, (float)context.透明度.Value)))
                    {
                        float w = 2800.0f;
                        float h = (float)context.太さ.Value;
                        var rc  = new RectangleF(-w / 2f, -h / 2f, w, h);
                        dc.FillRectangle(rc, brush);
                    }
                }
            });
            //----------------
            #endregion

            if (すべて完了)
            {
                if (this.現在のフェーズ == フェーズ.クローズ)
                {
                    this.現在のフェーズ = フェーズ.クローズ完了;
                }
                else if (this.現在のフェーズ == フェーズ.オープン)
                {
                    this.現在のフェーズ = フェーズ.オープン完了;
                }
            }
        }
Exemplo n.º 5
0
        protected override void 進行描画する(グラフィックデバイス gd, StoryboardStatus 描画しないStatus)
        {
            bool すべて完了 = true;

            gd.D2DBatchDraw((dc) => {
                var pretrans = dc.Transform;

                for (int i = シャッター枚数 - 1; i >= 0; i--)
                {
                    var context = this._シャッター情報[i];

                    if (context.ストーリーボード.Status != StoryboardStatus.Ready)
                    {
                        すべて完了 = false;
                    }

                    if (context.ストーリーボード.Status == 描画しないStatus)
                    {
                        continue;
                    }

                    dc.Transform =
                        Matrix3x2.Rotation(context.角度rad)
                        * Matrix3x2.Translation(context.開き中心位置 + (context.閉じ中心位置 - context.開き中心位置) * new Vector2((float)context.開to閉割合.Value))
                        * pretrans;
                    float w = context.矩形サイズ.Width;
                    float h = context.矩形サイズ.Height;
                    var rc  = new RectangleF(-w / 2f, -h / 2f, w, h);
                    dc.FillRectangle(rc, context.ブラシ);
                    dc.DrawRectangle(rc, this._白ブラシ, 3.0f);
                }
            });

            if (null != this._ロゴ不透明度)
            {
                if (this._ロゴボード.Status != StoryboardStatus.Ready)
                {
                    すべて完了 = false;
                }

                this._ロゴ.描画する(
                    gd,
                    this._ロゴ表示領域.Left,
                    this._ロゴ表示領域.Top,
                    透明度0to1: (float)this._ロゴ不透明度.Value,
                    X方向拡大率: (this._ロゴ表示領域.Width / this._ロゴ.サイズ.Width),
                    Y方向拡大率: (this._ロゴ表示領域.Height / this._ロゴ.サイズ.Height));
            }

            if (すべて完了)
            {
                if (this.現在のフェーズ == フェーズ.クローズ)
                {
                    this.現在のフェーズ = フェーズ.クローズ完了;
                }
                else if (this.現在のフェーズ == フェーズ.オープン)
                {
                    this.現在のフェーズ = フェーズ.オープン完了;
                }
            }
        }
Exemplo n.º 6
0
        protected override void 進行描画する(グラフィックデバイス gd, StoryboardStatus 描画しないStatus)
        {
            bool すべて完了 = true;

            gd.D2DBatchDraw((dc) => {
                var pretrans = dc.Transform;

                #region " ぐるぐる棒 "
                //----------------
                for (int i = 0; i < this._ぐるぐる棒s.Length; i++)
                {
                    var context = this._ぐるぐる棒s[i];

                    if (null == context || null == context.ストーリーボード)
                    {
                        continue;
                    }

                    if (context.ストーリーボード.Status != StoryboardStatus.Ready)
                    {
                        すべて完了 = false;
                    }

                    if (context.ストーリーボード.Status == 描画しないStatus)
                    {
                        continue;
                    }

                    dc.Transform =
                        Matrix3x2.Rotation((float)context.回転角rad.Value)
                        * Matrix3x2.Translation((float)context.中心位置X, (float)context.中心位置Y)
                        * pretrans;

                    float contextの幅  = 2800.0f;
                    float contextの高さ = (float)context.太さ.Value;

                    var rc = (context.辺の種類 == 辺の種類.辺) ?
                             new RectangleF(-contextの幅 / 2f, -(contextの高さ + (float)context.棒の太さ) / 2f, contextの幅, (float)context.棒の太さ) :                        // 上辺
                             new RectangleF(-contextの幅 / 2f, (contextの高さ - (float)context.棒の太さ) / 2f, contextの幅, (float)context.棒の太さ);                          // 下辺

                    dc.FillRectangle(rc, context.ブラシ);
                }
                //----------------
                #endregion

                #region " フラッシュオーバー棒[0~4] "
                //----------------
                for (int i = 0; i <= 4; i++)
                {
                    var context = this._フラッシュオーバー棒s[i];

                    if (null == context || null == context.ストーリーボード)
                    {
                        continue;
                    }

                    if (context.ストーリーボード.Status != StoryboardStatus.Ready)
                    {
                        すべて完了 = false;
                    }

                    if (context.ストーリーボード.Status == 描画しないStatus)
                    {
                        continue;
                    }

                    dc.Transform =
                        Matrix3x2.Rotation((float)context.回転角rad)
                        * Matrix3x2.Translation((float)context.中心位置X, (float)context.中心位置Y)
                        * pretrans;

                    float contextの幅  = 2800.0f;
                    float contextの高さ = (float)context.太さ.Value;

                    var rc = (context.辺の種類 == 辺の種類.辺) ?
                             new RectangleF(-contextの幅 / 2f, -(contextの高さ + (float)context.棒の太さ.Value) / 2f, contextの幅, (float)context.棒の太さ.Value) :                            // 上辺
                             new RectangleF(-contextの幅 / 2f, (contextの高さ - (float)context.棒の太さ.Value) / 2f, contextの幅, (float)context.棒の太さ.Value);                              // 下辺

                    dc.FillRectangle(rc, context.ブラシ);
                }
                //----------------
                #endregion
            });

            #region " Go! "
            //----------------
            foreach (var context in this._文字)
            {
                if (null == context.ストーリーボード)
                {
                    continue;
                }

                if (context.ストーリーボード.Status != StoryboardStatus.Ready)
                {
                    すべて完了 = false;
                }

                if (context.ストーリーボード.Status == 描画しないStatus)
                {
                    continue;
                }

                var 換行列2D =
                    Matrix3x2.Scaling((float)context.拡大率.Value)
                    * Matrix3x2.Translation((float)context.中心位置X.Value, (float)context.中心位置Y.Value);

                context.画像.描画する(gd, 換行列2D);
            }
            //----------------
            #endregion

            gd.D2DBatchDraw((dc) => {
                var pretrans = dc.Transform;

                #region " フラッシュオーバー棒[5] ... Go! の上にかぶせる"
                //----------------
                {
                    var context = this._フラッシュオーバー棒s[5];

                    if (null != context.ストーリーボード && context.ストーリーボード.Status != 描画しないStatus)
                    {
                        if (context.ストーリーボード.Status != StoryboardStatus.Ready)
                        {
                            すべて完了 = false;
                        }

                        dc.Transform =
                            Matrix3x2.Rotation((float)context.回転角rad)
                            * Matrix3x2.Translation((float)context.中心位置X, (float)context.中心位置Y)
                            * pretrans;

                        float contextの幅  = 2800.0f;
                        float contextの高さ = (float)context.太さ.Value;

                        var rc = (context.辺の種類 == 辺の種類.辺) ?
                                 new RectangleF(-contextの幅 / 2f, -(contextの高さ + (float)context.棒の太さ.Value) / 2f, contextの幅, (float)context.棒の太さ.Value) :                               // 上辺
                                 new RectangleF(-contextの幅 / 2f, (contextの高さ - (float)context.棒の太さ.Value) / 2f, contextの幅, (float)context.棒の太さ.Value);                                 // 下辺

                        dc.FillRectangle(rc, context.ブラシ);
                    }
                }
                //----------------
                #endregion

                #region " フェードイン "
                //----------------
                {
                    var context = this._フェードイン;

                    if (null != context && null != context.ストーリーボード && context.ストーリーボード.Status != 描画しないStatus)
                    {
                        if (context.ストーリーボード.Status != StoryboardStatus.Ready)
                        {
                            すべて完了 = false;
                        }

                        dc.Transform = pretrans;

                        using (var ブラシ = new SolidColorBrush(dc, new Color4(0.5f, 0.5f, 1f, (float)context.透明度.Value)))
                        {
                            dc.FillRectangle(new RectangleF(0f, 0f, 1920f, 1080f), ブラシ);
                        }
                    }
                }
                //----------------
                #endregion
            });

            if (すべて完了)
            {
                if (this.現在のフェーズ == フェーズ.クローズ)
                {
                    this.現在のフェーズ = フェーズ.クローズ完了;
                }
                else if (this.現在のフェーズ == フェーズ.オープン)
                {
                    this.現在のフェーズ = フェーズ.オープン完了;
                }
            }
        }
Exemplo n.º 7
0
        // 進行と描画


        /// <summary>
        ///     アイキャッチのアニメーションを進行し、アイキャッチ画像を描画する。
        /// </summary>
        protected override void 進行描画する(DeviceContext dc, StoryboardStatus 描画しないStatus)
        {
            bool すべて完了 = true;

            var preTrans = dc.Transform;

            #region " シャッター "
            //----------------
            for (int i = シャッター枚数 - 1; i >= 0; i--)
            {
                var context = this._シャッターアニメーション[i];

                if (context.ストーリーボード.Status != StoryboardStatus.Ready)
                {
                    すべて完了 = false;
                }

                if (context.ストーリーボード.Status == 描画しないStatus)
                {
                    continue;
                }

                dc.Transform =
                    Matrix3x2.Rotation(context.角度rad) *
                    Matrix3x2.Translation(context.開き中心位置 + (context.閉じ中心位置 - context.開き中心位置) * new Vector2((float)context.開to閉割合.Value)) *
                    preTrans;
                float w  = context.矩形サイズ.Width;
                float h  = context.矩形サイズ.Height;
                var   rc = new RectangleF(-w / 2f, -h / 2f, w, h);
                dc.FillRectangle(rc, context.ブラシ);
                dc.DrawRectangle(rc, this._白ブラシ, 3.0f);
            }

            dc.Transform = preTrans;
            //----------------
            #endregion

            if (null != this._ロゴ不透明度)
            {
                #region " ロゴ "
                //----------------
                if (this._ロゴボード.Status != StoryboardStatus.Ready)
                {
                    すべて完了 = false;
                }

                float 率 = this._ロゴ表示幅 / this._ロゴ.サイズ.Width;
                this._ロゴ.描画する(
                    dc,
                    this._ロゴ表示位置.Width,
                    this._ロゴ表示位置.Height,
                    透明度0to1: (float)this._ロゴ不透明度.Value,
                    X方向拡大率:  率,
                    Y方向拡大率:  率);
                //----------------
                #endregion
            }


            if (すべて完了)
            {
                if (this.現在のフェーズ == フェーズ.クローズ)
                {
                    this.現在のフェーズ = フェーズ.クローズ完了;
                }
                else if (this.現在のフェーズ == フェーズ.オープン)
                {
                    this.現在のフェーズ = フェーズ.オープン完了;
                }
            }
        }