コード例 #1
0
        public void FillGradientEllipse(float x, float y, float width, float height, System.Drawing.Color[] colors)
        {
            // Create the radial gradient brush properties object
            SharpDX.Direct2D1.RadialGradientBrushProperties radProp = new SharpDX.Direct2D1.RadialGradientBrushProperties
            {
                RadiusX = width,
                RadiusY = height,
                Center  = new SharpDX.Mathematics.Interop.RawVector2(x, y)
            };
            // Create a list of gratiend stops
            List <SharpDX.Direct2D1.GradientStop> stops = new List <SharpDX.Direct2D1.GradientStop>();

            // TODO: Create a color collection that also stores the color position
            // Auto calulate color position
            for (int i = 0; i < colors.Length; ++i)
            {
                SharpDX.Direct2D1.GradientStop stop = new SharpDX.Direct2D1.GradientStop
                {
                    Color    = ToColor(colors[i]),
                    Position = (float)(1.0 / colors.Length) * (i + 1)
                };
                stops.Add(stop);
            }

            SharpDX.Direct2D1.GradientStopCollection radStops = new SharpDX.Direct2D1.GradientStopCollection(d2dRenderTarget, stops.ToArray());
            SharpDX.Direct2D1.RadialGradientBrush    rgBrush  = new SharpDX.Direct2D1.RadialGradientBrush(d2dRenderTarget, ref radProp, radStops);
            SharpDX.Mathematics.Interop.RawVector2   center   = new SharpDX.Mathematics.Interop.RawVector2(x, y);
            SharpDX.Direct2D1.Ellipse ellipse = new SharpDX.Direct2D1.Ellipse(center, width, height);
            d2dRenderTarget.FillEllipse(ellipse, rgBrush);

            radStops.Dispose();
            rgBrush.Dispose();
        }
コード例 #2
0
        /// <summary>
        /// <p>Creates a rotation transformation that rotates by the specified angle about the specified point.</p>
        /// </summary>
        /// <param name = "angle"><dd>  <p>The clockwise rotation angle, in degrees. </p> </dd></param>
        /// <param name = "center"><dd>  <p>The point about which to rotate.</p> </dd></param>
        /// <param name = "matrix"><dd>  <p>When this method returns, contains the new rotation transformation. You must allocate storage for this parameter.  </p> </dd></param>
        /// <remarks>
        /// <p>Rotation occurs in the plane of the 2-D surface.</p>
        /// </remarks>
        /// <doc-id>dd368049</doc-id>
        /// <unmanaged>void D2D1MakeRotateMatrix([In] float angle,[In] D2D_POINT_2F center,[Out] D2D_MATRIX_3X2_F* matrix)</unmanaged>
        /// <unmanaged-short>D2D1MakeRotateMatrix</unmanaged-short>
        public static unsafe void MakeRotateMatrix(System.Single angle, SharpDX.Mathematics.Interop.RawVector2 center, out SharpDX.Mathematics.Interop.RawMatrix3x2 matrix)
        {
            matrix = default(SharpDX.Mathematics.Interop.RawMatrix3x2);

            fixed(void *matrix_ = &matrix)
            D2D1MakeRotateMatrix_(angle, center, matrix_);
        }
コード例 #3
0
        public void FillEllipse(float x, float y, float width, float height, System.Drawing.Color clr)
        {
            SharpDX.Mathematics.Interop.RawVector2 center = new SharpDX.Mathematics.Interop.RawVector2(x, y);
            SharpDX.Direct2D1.SolidColorBrush      brush  = new SharpDX.Direct2D1.SolidColorBrush(d2dRenderTarget, ToColor(clr));
            SharpDX.Direct2D1.Ellipse ellipse             = new SharpDX.Direct2D1.Ellipse(center, width, height);
            d2dRenderTarget.FillEllipse(ellipse, brush);

            brush.Dispose();
        }
コード例 #4
0
        /// <summary>
        /// <p>Creates a rotation transformation that rotates by the specified angle about the specified point.</p>
        /// </summary>
        /// <param name="angle"><dd>  <p>The clockwise rotation angle, in degrees. </p> </dd></param>
        /// <param name="center"><dd>  <p>The point about which to rotate.</p> </dd></param>
        /// <param name="matrix"><dd>  <p>When this method returns, contains the new rotation transformation. You must allocate storage for this parameter.  </p> </dd></param>
        /// <remarks>
        /// <p>Rotation occurs in the plane of the 2-D surface.</p><p><strong>Windows Phone 8.1:</strong> This API is supported.</p>
        /// </remarks>
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D2D1MakeRotateMatrix']/*"/>
        /// <msdn-id>dd368049</msdn-id>
        /// <unmanaged>void D2D1MakeRotateMatrix([In] float angle,[In] D2D_POINT_2F center,[Out] D2D_MATRIX_3X2_F* matrix)</unmanaged>
        /// <unmanaged-short>D2D1MakeRotateMatrix</unmanaged-short>
        public static void MakeRotateMatrix(float angle, SharpDX.Mathematics.Interop.RawVector2 center, out SharpDX.Mathematics.Interop.RawMatrix3x2 matrix)
        {
            unsafe {
                matrix = new SharpDX.Mathematics.Interop.RawMatrix3x2();

                fixed(void *matrix_ = &matrix)
                D2D1MakeRotateMatrix_(angle, center, matrix_);
            }
        }
コード例 #5
0
        public static SharpDX.Mathematics.Interop.RawVector2[] ConvertToRawVector2(this SharpDX.Vector2 [] array)
        {
            SharpDX.Mathematics.Interop.RawVector2[] result = new SharpDX.Mathematics.Interop.RawVector2[array.Length];

            for (int index = 0; index < array.Length; index++)
            {
                result[index] = new SharpDX.Mathematics.Interop.RawVector2(array[index].X, array[index].Y);
            }

            return(result);
        }
コード例 #6
0
        public void DrawLine(float x0, float y0, float x1, float y1, System.Drawing.Color clr)
        {
            SharpDX.Mathematics.Interop.RawVector2 p0 = new SharpDX.Mathematics.Interop.RawVector2 {
                X = x0, Y = y0
            };
            SharpDX.Mathematics.Interop.RawVector2 p1 = new SharpDX.Mathematics.Interop.RawVector2 {
                X = x1, Y = y1
            };
            SharpDX.Direct2D1.SolidColorBrush brush = new SharpDX.Direct2D1.SolidColorBrush(d2dRenderTarget, ToColor(clr));
            d2dRenderTarget.DrawLine(p0, p1, brush);

            brush.Dispose();
        }
コード例 #7
0
        public static void DrawCircle(WindowRenderTarget renderTarget, float radius, SharpDX.Mathematics.Interop.RawVector2 center, D2D.Brush brush, float strokeWidth = 1f, StrokeStyle strokeStyle = null)
        {
            Ellipse ellipse = new Ellipse(center, radius, radius);

            if (strokeStyle == null)
            {
                renderTarget.DrawEllipse(ellipse, brush, strokeWidth);
            }
            else
            {
                renderTarget.DrawEllipse(ellipse, brush, strokeWidth, strokeStyle);
            }
        }
コード例 #8
0
        public void BeginFigure(SharpDX.Mathematics.Interop.RawVector2 startPoint, FigureBegin figureBegin)
        {
            this.m_figureVertices.Clear();

            Vertex2D v = new Vertex2D()
            {
                pt     = *(Vector2 *)&startPoint,
                inter1 = Vector2.Zero,
                inter2 = Vector2.Zero,
                norm   = Vector2.Zero
            };

            this.m_figureVertices.Add(v);
        }
コード例 #9
0
        /// <summary>
        /// <p>Returns the interior points for a gradient mesh patch based on the points defining a Coons patch.</p><strong>Note</strong>??<p>This function is called by the <strong>GradientMeshPatchFromCoonsPatch</strong> function and is not intended to be used directly.</p>?
        /// </summary>
        /// <param name="point0Ref">No documentation.</param>
        /// <param name="point1Ref">No documentation.</param>
        /// <param name="point2Ref">No documentation.</param>
        /// <param name="point3Ref">No documentation.</param>
        /// <param name="point4Ref">No documentation.</param>
        /// <param name="point5Ref">No documentation.</param>
        /// <param name="point6Ref">No documentation.</param>
        /// <param name="point7Ref">No documentation.</param>
        /// <param name="point8Ref">No documentation.</param>
        /// <param name="point9Ref">No documentation.</param>
        /// <param name="point10Ref">No documentation.</param>
        /// <param name="point11Ref">No documentation.</param>
        /// <param name="tensorPoint11Ref">No documentation.</param>
        /// <param name="tensorPoint12Ref">No documentation.</param>
        /// <param name="tensorPoint21Ref">No documentation.</param>
        /// <param name="tensorPoint22Ref">No documentation.</param>
        /// <remarks>
        /// <p>This function is called by the <strong>GradientMeshPatchFromCoonsPatch</strong> function and is not intended to be used directly.</p>
        /// </remarks>
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D2D1GetGradientMeshInteriorPointsFromCoonsPatch']/*"/>
        /// <msdn-id>mt149083</msdn-id>
        /// <unmanaged>void D2D1GetGradientMeshInteriorPointsFromCoonsPatch([In] const D2D_POINT_2F* pPoint0,[In] const D2D_POINT_2F* pPoint1,[In] const D2D_POINT_2F* pPoint2,[In] const D2D_POINT_2F* pPoint3,[In] const D2D_POINT_2F* pPoint4,[In] const D2D_POINT_2F* pPoint5,[In] const D2D_POINT_2F* pPoint6,[In] const D2D_POINT_2F* pPoint7,[In] const D2D_POINT_2F* pPoint8,[In] const D2D_POINT_2F* pPoint9,[In] const D2D_POINT_2F* pPoint10,[In] const D2D_POINT_2F* pPoint11,[Out] D2D_POINT_2F* pTensorPoint11,[Out] D2D_POINT_2F* pTensorPoint12,[Out] D2D_POINT_2F* pTensorPoint21,[Out] D2D_POINT_2F* pTensorPoint22)</unmanaged>
        /// <unmanaged-short>D2D1GetGradientMeshInteriorPointsFromCoonsPatch</unmanaged-short>
        public static void GetGradientMeshInteriorPointsFromCoonsPatch(SharpDX.Mathematics.Interop.RawVector2 point0Ref, SharpDX.Mathematics.Interop.RawVector2 point1Ref, SharpDX.Mathematics.Interop.RawVector2 point2Ref, SharpDX.Mathematics.Interop.RawVector2 point3Ref, SharpDX.Mathematics.Interop.RawVector2 point4Ref, SharpDX.Mathematics.Interop.RawVector2 point5Ref, SharpDX.Mathematics.Interop.RawVector2 point6Ref, SharpDX.Mathematics.Interop.RawVector2 point7Ref, SharpDX.Mathematics.Interop.RawVector2 point8Ref, SharpDX.Mathematics.Interop.RawVector2 point9Ref, SharpDX.Mathematics.Interop.RawVector2 point10Ref, SharpDX.Mathematics.Interop.RawVector2 point11Ref, out SharpDX.Mathematics.Interop.RawVector2 tensorPoint11Ref, out SharpDX.Mathematics.Interop.RawVector2 tensorPoint12Ref, out SharpDX.Mathematics.Interop.RawVector2 tensorPoint21Ref, out SharpDX.Mathematics.Interop.RawVector2 tensorPoint22Ref)
        {
            unsafe {
                tensorPoint11Ref = new SharpDX.Mathematics.Interop.RawVector2();
                tensorPoint12Ref = new SharpDX.Mathematics.Interop.RawVector2();
                tensorPoint21Ref = new SharpDX.Mathematics.Interop.RawVector2();
                tensorPoint22Ref = new SharpDX.Mathematics.Interop.RawVector2();

                fixed(void *tensorPoint11Ref_ = &tensorPoint11Ref)
                fixed(void *tensorPoint12Ref_ = &tensorPoint12Ref)
                fixed(void *tensorPoint21Ref_ = &tensorPoint21Ref)
                fixed(void *tensorPoint22Ref_ = &tensorPoint22Ref)
                D2D1GetGradientMeshInteriorPointsFromCoonsPatch_(&point0Ref, &point1Ref, &point2Ref, &point3Ref, &point4Ref, &point5Ref, &point6Ref, &point7Ref, &point8Ref, &point9Ref, &point10Ref, &point11Ref, tensorPoint11Ref_, tensorPoint12Ref_, tensorPoint21Ref_, tensorPoint22Ref_);
            }
        }
コード例 #10
0
        public void AddLines(SharpDX.Mathematics.Interop.RawVector2[] pointsRef)
        {
            for (int i = 0; i < pointsRef.Length; i++)
            {
                SharpDX.Mathematics.Interop.RawVector2 rawPoint = pointsRef[i];
                Vertex2D v = new Vertex2D();
                v.pt = *(Vector2 *)&rawPoint;

                m_figureVertices.Add(v);

                /*if (m_figureVertices.Count > 0)
                 * {
                 *
                 * }*/
            }
        }
コード例 #11
0
 public void AddLine(SharpDX.Mathematics.Interop.RawVector2 point)
 {
 }
コード例 #12
0
ファイル: ESPForm.cs プロジェクト: leeza007/pubghack
 public void DrawLine(RawVector2 a, RawVector2 b, IBrush gcolr)
 {
     _graphics.DrawLine(_boxBrush, a.X, a.Y, b.X, b.Y, 1f);
 }
コード例 #13
0
ファイル: ESPForm.cs プロジェクト: leeza007/pubghack
        private void Draw3DBox(D3DMatrix viewMatrix, PlayerData player, ShpVector3 playersc, int winWidth, int winHeight, float hei = 180f)
        {
            float num  = 70f;
            float num2 = 60f;
            float num3 = 50f;
            float num4 = 85f;

            hei = 180f;
            ShpVector3 vector  = new ShpVector3(num3, -num2 / 2f, 0f);
            ShpVector3 vector2 = new ShpVector3(num3, num2 / 2f, 0f);
            ShpVector3 vector3 = new ShpVector3(num3 - num, num2 / 2f, 0f);
            ShpVector3 vector4 = new ShpVector3(num3 - num, -num2 / 2f, 0f);

            Matrix     matrix  = Matrix.RotationZ((6.28318548f * (player.Position.Y) / 180f / 2f));
            ShpVector3 vector5 = new ShpVector3(player.Position.X, player.Position.Y, player.Position.Z - num4);

            vector  = ShpVector3.TransformCoordinate(vector, matrix) + vector5;
            vector2 = ShpVector3.TransformCoordinate(vector2, matrix) + vector5;
            vector3 = ShpVector3.TransformCoordinate(vector3, matrix) + vector5;
            vector4 = ShpVector3.TransformCoordinate(vector4, matrix) + vector5;
            ShpVector2 vector6;

            if (!Algorithms.WorldToScreen3DBox(viewMatrix, vector, out vector6, winWidth, winHeight))
            {
                return;
            }
            ShpVector2 vector7;

            if (!Algorithms.WorldToScreen3DBox(viewMatrix, vector2, out vector7, winWidth, winHeight))
            {
                return;
            }
            ShpVector2 vector8;

            if (!Algorithms.WorldToScreen3DBox(viewMatrix, vector3, out vector8, winWidth, winHeight))
            {
                return;
            }
            ShpVector2 vector9;

            if (!Algorithms.WorldToScreen3DBox(viewMatrix, vector4, out vector9, winWidth, winHeight))
            {
                return;
            }

            RawVector2[] array = new RawVector2[]
            {
                vector6,
                vector7,
                vector8,
                vector9,
                vector6
            };
            DrawLines(array, _boxBrush);
            vector.Z += hei;

            bool arg_240_0 = Algorithms.WorldToScreen3DBox(viewMatrix, vector, out vector6, winWidth, winHeight);

            vector2.Z += hei;
            bool flag = Algorithms.WorldToScreen3DBox(viewMatrix, vector2, out vector7, winWidth, winHeight);

            vector3.Z += hei;
            bool flag2 = Algorithms.WorldToScreen3DBox(viewMatrix, vector3, out vector8, winWidth, winHeight);

            vector4.Z += hei;
            bool flag3 = Algorithms.WorldToScreen3DBox(viewMatrix, vector4, out vector9, winWidth, winHeight);

            if (!arg_240_0 || !flag || !flag2 || !flag3)
            {
                return;
            }
            RawVector2[] array2 = new RawVector2[]
            {
                vector6,
                vector7,
                vector8,
                vector9,
                vector6
            };
            DrawLines(array2, _boxBrush);
            DrawLine(new RawVector2(array[0].X, array[0].Y), new RawVector2(array2[0].X, array2[0].Y), _boxBrush);
            DrawLine(new RawVector2(array[1].X, array[1].Y), new RawVector2(array2[1].X, array2[1].Y), _boxBrush);
            DrawLine(new RawVector2(array[2].X, array[2].Y), new RawVector2(array2[2].X, array2[2].Y), _boxBrush);
            DrawLine(new RawVector2(array[3].X, array[3].Y), new RawVector2(array2[3].X, array2[3].Y), _boxBrush);
        }
コード例 #14
0
 private unsafe static extern void D2D1MakeSkewMatrix_(float param0, float param1, SharpDX.Mathematics.Interop.RawVector2 param2, void *param3);
コード例 #15
0
 public static unsafe void Callivoid91(void *thisObject, SharpDX.Mathematics.Interop.RawVector2 arg0, void *arg1, void *arg2, void *arg3, int arg4, void *methodPtr)
 {
     throw new NotImplementedException();
 }
コード例 #16
0
 private unsafe static extern void D2D1MakeSkewMatrix_(float arg0, float arg1, SharpDX.Mathematics.Interop.RawVector2 arg2, void *arg3);
コード例 #17
0
ファイル: FlatSink.cs プロジェクト: domjancik/CraftLie
 public void BeginFigure(SharpDX.Mathematics.Interop.RawVector2 startPoint, FigureBegin figureBegin)
 {
 }
コード例 #18
0
        /// <param name="行番号">
        ///		一番上:0 ~ 9:一番下。
        ///		「静止時の」可視範囲は 1~8。4 がフォーカスノード。
        ///	</param>
        private void _リストを1行描画する(DeviceContext dc, int 行番号, Node node)
        {
            bool 選択ノードである = (4 == 行番号);

            float 実数行番号 = 行番号 + this._曲リスト全体のY軸移動オフセット / 100.0f;

            var ノード左上dpx = new Vector3( // テクスチャは画面中央が (0,0,0) で、Xは右がプラス方向, Yは上がプラス方向, Zは奥がプラス方向+。
                this._曲リストの基準左上隅座標dpx.X + (選択ノードである ? (float)(this._選択ノードの表示オフセットdpx?.Value ?? 0f) : 0f),
                this._曲リストの基準左上隅座標dpx.Y + (実数行番号 * _ノードの高さdpx),
                0f);

            #region " 背景 "
            //----------------
            Global.D2DBatchDraw(dc, () => {
                dc.PrimitiveBlend = PrimitiveBlend.SourceOver;

                if (node is BoxNode)
                {
                    #region " BOXノードの背景 "
                    //----------------
                    using var brush        = new SolidColorBrush(dc, new Color4(0xffa3647c));
                    using var pathGeometry = new PathGeometry(Global.D2D1Factory1);
                    using (var sink = pathGeometry.Open())
                    {
                        sink.SetFillMode(FillMode.Winding);
                        sink.BeginFigure(new Vector2(ノード左上dpx.X, ノード左上dpx.Y + 8f), FigureBegin.Filled); // 点1
                        var points = new SharpDX.Mathematics.Interop.RawVector2[] {
                            new Vector2(ノード左上dpx.X + 150f, ノード左上dpx.Y + 8f),                            // → 点2
                            new Vector2(ノード左上dpx.X + 170f, ノード左上dpx.Y + 18f),                           // → 点3
                            new Vector2(Global.設計画面サイズ.Width, ノード左上dpx.Y + 18f),                        // → 点4
                            new Vector2(Global.設計画面サイズ.Width, ノード左上dpx.Y + _ノードの高さdpx),                 // → 点5
                            new Vector2(ノード左上dpx.X, ノード左上dpx.Y + _ノードの高さdpx),                           // → 点6
                            new Vector2(ノード左上dpx.X, ノード左上dpx.Y + 8f),                                   // → 点1
                        };
                        sink.AddLines(points);
                        sink.EndFigure(FigureEnd.Closed);
                        sink.Close();
                    }
                    dc.FillGeometry(pathGeometry, brush);
                    //----------------
                    #endregion
                }
                else if (node is BackNode || node is RandomSelectNode)
                {
                    #region " BACK, RandomSelectノードの背景 "
                    //----------------
                    using var brush        = new SolidColorBrush(dc, Color4.Black);
                    using var pathGeometry = new PathGeometry(Global.D2D1Factory1);
                    using (var sink = pathGeometry.Open())
                    {
                        sink.SetFillMode(FillMode.Winding);
                        sink.BeginFigure(new Vector2(ノード左上dpx.X, ノード左上dpx.Y + 8f), FigureBegin.Filled);   // 点1
                        var points = new SharpDX.Mathematics.Interop.RawVector2[] {
                            new Vector2(ノード左上dpx.X + 150f, ノード左上dpx.Y + 8f),                              // → 点2
                            new Vector2(ノード左上dpx.X + 170f, ノード左上dpx.Y + 18f),                             // → 点3
                            new Vector2(Global.設計画面サイズ.Width, ノード左上dpx.Y + 18f),                          // → 点4
                            new Vector2(Global.設計画面サイズ.Width, ノード左上dpx.Y + _ノードの高さdpx),                   // → 点5
                            new Vector2(ノード左上dpx.X, ノード左上dpx.Y + _ノードの高さdpx),                             // → 点6
                            new Vector2(ノード左上dpx.X, ノード左上dpx.Y + 8f),                                     // → 点1
                        };
                        sink.AddLines(points);
                        sink.EndFigure(FigureEnd.Closed);
                        sink.Close();
                    }
                    dc.FillGeometry(pathGeometry, brush);
                    //----------------
                    #endregion
                }
                else
                {
                    #region " 既定の背景 "
                    //----------------
                    using var brush = new SolidColorBrush(dc, new Color4(0f, 0f, 0f, 0.25f));       // 半透明の黒
                    dc.FillRectangle(new RectangleF(ノード左上dpx.X, ノード左上dpx.Y, Global.設計画面サイズ.Width - ノード左上dpx.X, _ノードの高さdpx), brush);
                    //----------------
                    #endregion
                }
            });
            //----------------
            #endregion

            #region " サムネイル画像 "
            //----------------
            {
                // ノード画像を縮小して表示する。
                var ノード画像 = node.現行化済み ? (node.ノード画像 ?? this._既定のノード画像) : this._現行化前のノード画像;

                var ノード内サムネイルオフセットdpx = new Vector3(58f, 4f, 0f);
                var サムネイル表示中央dpx      = new Vector3(
                    Global.画面左上dpx.X + ノード左上dpx.X + (this._サムネイル表示サイズdpx.X / 2f) + ノード内サムネイルオフセットdpx.X,
                    Global.画面左上dpx.Y - ノード左上dpx.Y - (this._サムネイル表示サイズdpx.Y / 2f) - ノード内サムネイルオフセットdpx.Y,
                    0f);

                if (node is BoxNode)
                {
                    #region " BOXノードのサムネイル画像 → 普通のノードよりも少し小さく表示する(涙 "
                    //----------------
                    var 換行列 =
                        Matrix.Scaling(
                            this._サムネイル表示サイズdpx.X / ノード画像.サイズ.Width,
                            this._サムネイル表示サイズdpx.Y / ノード画像.サイズ.Height,
                            0f) *
                        Matrix.Scaling(0.9f) *                     // ちょっと小さく
                        Matrix.Translation(サムネイル表示中央dpx - 4f);     // ちょっと下へ

                    ノード画像.描画する(換行列);
                    //----------------
                    #endregion
                }
                else if (node is BackNode || node is RandomSelectNode)
                {
                    // BACK, RandomSelectノードはサムネイル画像なし
                }
                else
                {
                    #region " 既定のサムネイル画像 "
                    //----------------
                    var 換行列 =
                        Matrix.Scaling(
                            this._サムネイル表示サイズdpx.X / ノード画像.サイズ.Width,
                            this._サムネイル表示サイズdpx.Y / ノード画像.サイズ.Height,
                            0f) *
                        Matrix.Translation(サムネイル表示中央dpx);

                    ノード画像.描画する(換行列);
                    //----------------
                    #endregion
                }
            }
            //----------------
            #endregion

            #region " 成績 "
            //----------------
            if (node is SongNode snode)
            {
                var score = snode.曲.フォーカス譜面;
                if (score.最高記録を現行化済み && (null != score.最高記録))
                {
                    var 最高ランク = score.最高ランク !;
                    var 達成率   = score.最高記録.Achievement;

                    #region " 成績アイコン "
                    //----------------
                    this._成績アイコン.描画する(
                        ノード左上dpx.X + 6f,
                        ノード左上dpx.Y + 57f,
                        転送元矩形: this._成績アイコンの矩形リスト[最高ランク.ToString() !]);
コード例 #19
0
 private unsafe static extern void D2D1MakeRotateMatrix_(float arg0, SharpDX.Mathematics.Interop.RawVector2 arg1, void *arg2);
コード例 #20
0
 public static unsafe int Calliint7(void *thisObject, SharpDX.Mathematics.Interop.RawVector2 arg0, void *arg1, float arg2, void *arg3, void *methodPtr)
 {
     throw new NotImplementedException();
 }
コード例 #21
0
 private unsafe static extern void D2D1MakeRotateMatrix_(float param0, SharpDX.Mathematics.Interop.RawVector2 param1, void *param2);
コード例 #22
0
        /// <param name="行番号">
        ///		一番上:0 ~ 9:一番下。
        ///		「静止時の」可視範囲は 1~8。
        ///		4 がフォーカスノード。
        ///	</param>
        private void _ノードを描画する(DeviceContext1 dc, int 行番号, Node ノード)
        {
            Debug.Assert(0 <= 行番号 && 9 >= 行番号);
            Debug.Assert(null != ノード);
            Debug.Assert((ノード as RootNode) is null);

            var  ノード画像    = ノード.ノード画像 ?? Node.既定のノード画像;
            bool 選択ノードである = (4 == 行番号);

            if (null == ノード画像)
            {
                return;
            }

            // テクスチャは画面中央が (0,0,0) で、Xは右がプラス方向, Yは上がプラス方向, Zは奥がプラス方向+。

            var 画面左上dpx = new Vector3(  // 3D視点で見る画面左上の座標。
                -グラフィックデバイス.Instance.設計画面サイズ.Width / 2f,
                +グラフィックデバイス.Instance.設計画面サイズ.Height / 2f,
                0f);

            var 実数行番号 = 行番号 + (this._曲リスト全体のY軸移動オフセット / 100f);

            var ノード左上dpx = new Vector3(
                this._曲リストの基準左上隅座標dpx.X + ((選択ノードである) ? (float)this._選択ノードの表示オフセットdpx.Value : 0f),
                this._曲リストの基準左上隅座標dpx.Y + (実数行番号 * _ノードの高さdpx),
                0f);

            #region " 背景 "
            //----------------
            グラフィックデバイス.Instance.D2DBatchDraw(dc, () => {
                if (ノード is BoxNode)
                {
                    #region " BOXノードの背景 "
                    //----------------
                    using (var brush = new SolidColorBrush(dc, new Color4(0xffa3647c)))
                    {
                        using (var pathGeometry = new PathGeometry(グラフィックデバイス.Instance.D2DFactory))
                        {
                            using (var sink = pathGeometry.Open())
                            {
                                sink.SetFillMode(FillMode.Winding);
                                sink.BeginFigure(new Vector2(ノード左上dpx.X, ノード左上dpx.Y + 8f), FigureBegin.Filled); // 1
                                var points = new SharpDX.Mathematics.Interop.RawVector2[] {
                                    new Vector2(ノード左上dpx.X + 150f, ノード左上dpx.Y + 8f),                            // 2
                                    new Vector2(ノード左上dpx.X + 170f, ノード左上dpx.Y + 18f),                           // 3
                                    new Vector2(グラフィックデバイス.Instance.設計画面サイズ.Width, ノード左上dpx.Y + 18f),           // 4
                                    new Vector2(グラフィックデバイス.Instance.設計画面サイズ.Width, ノード左上dpx.Y + _ノードの高さdpx),    // 5
                                    new Vector2(ノード左上dpx.X, ノード左上dpx.Y + _ノードの高さdpx),                           // 6
                                    new Vector2(ノード左上dpx.X, ノード左上dpx.Y + 8f),                                   // 1
                                };
                                sink.AddLines(points);
                                sink.EndFigure(FigureEnd.Closed);
                                sink.Close();
                            }

                            dc.FillGeometry(pathGeometry, brush);
                        }
                    }
                    //----------------
                    #endregion
                }
                else if (ノード is BackNode)
                {
                    #region " BACKノードの背景 "
                    //----------------
                    using (var brush = new SolidColorBrush(dc, Color4.Black))
                    {
                        using (var pathGeometry = new PathGeometry(グラフィックデバイス.Instance.D2DFactory))
                        {
                            using (var sink = pathGeometry.Open())
                            {
                                sink.SetFillMode(FillMode.Winding);
                                sink.BeginFigure(new Vector2(ノード左上dpx.X, ノード左上dpx.Y + 8f), FigureBegin.Filled); // 1
                                var points = new SharpDX.Mathematics.Interop.RawVector2[] {
                                    new Vector2(ノード左上dpx.X + 150f, ノード左上dpx.Y + 8f),                            // 2
                                    new Vector2(ノード左上dpx.X + 170f, ノード左上dpx.Y + 18f),                           // 3
                                    new Vector2(グラフィックデバイス.Instance.設計画面サイズ.Width, ノード左上dpx.Y + 18f),           // 4
                                    new Vector2(グラフィックデバイス.Instance.設計画面サイズ.Width, ノード左上dpx.Y + _ノードの高さdpx),    // 5
                                    new Vector2(ノード左上dpx.X, ノード左上dpx.Y + _ノードの高さdpx),                           // 6
                                    new Vector2(ノード左上dpx.X, ノード左上dpx.Y + 8f),                                   // 1
                                };
                                sink.AddLines(points);
                                sink.EndFigure(FigureEnd.Closed);
                                sink.Close();
                            }

                            dc.FillGeometry(pathGeometry, brush);
                        }
                    }
                    //----------------
                    #endregion
                }
                else
                {
                    #region " 既定の背景(半透明の黒)"
                    //----------------
                    using (var brush = new SolidColorBrush(dc, new Color4(0f, 0f, 0f, 0.25f)))
                        dc.FillRectangle(new RectangleF(ノード左上dpx.X, ノード左上dpx.Y, グラフィックデバイス.Instance.設計画面サイズ.Width - ノード左上dpx.X, _ノードの高さdpx), brush);
                    //----------------
                    #endregion
                }
            });
            //----------------
            #endregion

            #region " サムネイル画像 "
            //----------------
            if (ノード is BoxNode)
            {
                #region " BOXノードのサムネイル画像 → 少し小さく表示する(涙 "
                //----------------
                var ノード内サムネイルオフセットdpx = new Vector3(58f, 4f, 0f);

                var サムネイル表示中央dpx = new Vector3(
                    画面左上dpx.X + ノード左上dpx.X + (this._サムネイル表示サイズdpx.X / 2f) + ノード内サムネイルオフセットdpx.X,
                    画面左上dpx.Y - ノード左上dpx.Y - (this._サムネイル表示サイズdpx.Y / 2f) - ノード内サムネイルオフセットdpx.Y,
                    0f);

                var 換行列 =
                    Matrix.Scaling(this._サムネイル表示サイズdpx * 0.9f) *    // ちょっと小さく
                    Matrix.Translation(サムネイル表示中央dpx - 4f);          // ちょっと下へ

                ノード.進行描画する(dc, 換行列, キャプション表示: false);
                //----------------
                #endregion
            }
            else if (ノード is BackNode)
            {
                // BACKノードはサムネイル画像なし
            }
            else
            {
                #region " 既定のサムネイル画像 "
                //----------------
                var ノード内サムネイルオフセットdpx = new Vector3(58f, 4f, 0f);

                var サムネイル表示中央dpx = new Vector3(
                    画面左上dpx.X + ノード左上dpx.X + (this._サムネイル表示サイズdpx.X / 2f) + ノード内サムネイルオフセットdpx.X,
                    画面左上dpx.Y - ノード左上dpx.Y - (this._サムネイル表示サイズdpx.Y / 2f) - ノード内サムネイルオフセットdpx.Y,
                    0f);

                var 換行列 =
                    Matrix.Scaling(this._サムネイル表示サイズdpx) *
                    Matrix.Translation(サムネイル表示中央dpx);

                ノード.進行描画する(dc, 換行列, キャプション表示: false);
                //----------------
                #endregion
            }
            //----------------
            #endregion

            #region " タイトル文字列 "
            //----------------
            {
                var 曲名画像 = (文字列画像)null;

                // 曲名画像を取得する。未生成なら生成する。
                if (!(this._ノードto曲名画像.ContainsKey(ノード)))
                {
                    曲名画像 = new 文字列画像()
                    {
                        表示文字列     = ノード.タイトル,
                        フォント名     = "HGMaruGothicMPRO", // "メイリオ",
                        フォント幅     = FontWeight.Regular,
                        フォントスタイル  = FontStyle.Normal,
                        フォントサイズpt = 40f,
                        描画効果      = 文字列画像.効果.縁取り,
                        縁のサイズdpx  = 6f,
                        前景色       = Color4.Black,
                        背景色       = Color4.White,
                    };
                    曲名画像.活性化する();

                    this._ノードto曲名画像.Add(ノード, 曲名画像);
                }
                else
                {
                    曲名画像 = this._ノードto曲名画像[ノード];
                }

                // 拡大率を計算して描画する。
                float 最大幅dpx = グラフィックデバイス.Instance.設計画面サイズ.Width - ノード左上dpx.X - 170f;
                曲名画像.描画する(
                    dc,
                    ノード左上dpx.X + 170f,
                    ノード左上dpx.Y + 30f,
                    X方向拡大率: (曲名画像.画像サイズdpx.Width <= 最大幅dpx) ? 1f : 最大幅dpx / 曲名画像.画像サイズdpx.Width);
            }
            //----------------
            #endregion
            #region " サブタイトル文字列 "
            //----------------
            if (ノード == App.曲ツリー.フォーカスノード)   // フォーカスノードのみ表示する。
            {
                var サブタイトル画像 = (文字列画像)null;

                // ノードが SetNode なら難易度アンカに応じた MusicNode が対象。
                if (ノード is SetNode setnode)
                {
                    ノード = App.曲ツリー.現在の難易度に応じた曲ノードを返す(setnode);
                }

                // サブタイトル画像を取得する。未生成かつ指定があるなら生成する。
                if (!(this._ノードtoサブタイトル画像.ContainsKey(ノード)))
                {
                    if (ノード.サブタイトル.Nullでも空でもない())
                    {
                        サブタイトル画像 = new 文字列画像()
                        {
                            表示文字列     = ノード.サブタイトル,
                            フォント名     = "HGMaruGothicMPRO", // "メイリオ",
                            フォント幅     = FontWeight.Regular,
                            フォントスタイル  = FontStyle.Normal,
                            フォントサイズpt = 20f,
                            描画効果      = 文字列画像.効果.縁取り,
                            縁のサイズdpx  = 4f,
                            前景色       = Color4.Black,
                            背景色       = Color4.White,
                        };
                        サブタイトル画像.活性化する();

                        this._ノードtoサブタイトル画像.Add(ノード, サブタイトル画像);
                    }
                    else
                    {
                        // 指定がない
                        サブタイトル画像 = null;
                    }
                }
                else
                {
                    サブタイトル画像 = this._ノードtoサブタイトル画像[ノード];
                }

                // 拡大率を計算して描画する。
                if (null != サブタイトル画像)
                {
                    float 最大幅dpx = グラフィックデバイス.Instance.設計画面サイズ.Width - ノード左上dpx.X - 170f;

                    サブタイトル画像.描画する(
                        dc,
                        ノード左上dpx.X + 190f,
                        ノード左上dpx.Y + 80f,
                        X方向拡大率: (サブタイトル画像.画像サイズdpx.Width <= 最大幅dpx) ? 1f : 最大幅dpx / サブタイトル画像.画像サイズdpx.Width);
                }
            }
            //----------------
            #endregion
        }
コード例 #23
0
 public static unsafe void CalliFuncvoid193(float arg0, SharpDX.Mathematics.Interop.RawVector2 arg1, void *arg2, void *funcPtr)
 {
     throw new NotImplementedException();
 }