当前位置: 首页>>代码示例>>C#>>正文


C# ICanvas.FillMusicFontSymbol方法代码示例

本文整理汇总了C#中ICanvas.FillMusicFontSymbol方法的典型用法代码示例。如果您正苦于以下问题:C# ICanvas.FillMusicFontSymbol方法的具体用法?C# ICanvas.FillMusicFontSymbol怎么用?C# ICanvas.FillMusicFontSymbol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICanvas的用法示例。


在下文中一共展示了ICanvas.FillMusicFontSymbol方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Paint

        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            var res = Renderer.Resources;
            canvas.Font = res.MarkerFont;

            canvas.FillMusicFontSymbol(cx + X, cy + Y + Renderer.Height * 0.75f, 0.75f, MusicFontSymbol.Tempo);
            canvas.FillText("= " + _tempo, cx + X + (15 * Scale), cy + Y + canvas.Font.Size / 2);
        }
开发者ID:CoderLine,项目名称:alphaTab,代码行数:8,代码来源:TempoGlyph.cs

示例2: Paint

        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            var res = Renderer.Resources;
            canvas.Font = res.MarkerFont;

            canvas.FillMusicFontSymbol(cx+ X, cy + Y, 1, MusicFontSymbol.Tempo);
            canvas.FillText("" + _tempo, cx + X + (20 * Scale), cy + X + (7 * Scale));
        }
开发者ID:eriser,项目名称:alphaTab,代码行数:8,代码来源:TempoGlyph.cs

示例3: Paint

 public override void Paint(float cx, float cy, ICanvas canvas)
 {
     var prevColor = canvas.Color;
     if(this.IsHighlighted)
     {
         canvas.Color = Platform.Model.Color.Red;
     }
     //canvas.Color = Platform.Model.Color.Red;
     canvas.FillMusicFontSymbol(cx + X, cy + Y, _scale*Scale, _symbol);
     canvas.Color = prevColor;
 }
开发者ID:stefan-j,项目名称:alphaTab,代码行数:11,代码来源:MusicFontGlyph.cs

示例4: Paint

        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            var step = 11 * Scale * _scale;
            var loops = Math.Max(1, (Width / step));

            var loopX = 0f;
            for (var i = 0; i < loops; i++)
            {
                canvas.FillMusicFontSymbol(cx + X + loopX, cy +Y, _scale, MusicFontSymbol.WaveHorizontal);
                loopX += step;
            }
        }
开发者ID:eriser,项目名称:alphaTab,代码行数:12,代码来源:VibratoGlyph.cs

示例5: PaintGrouped

        protected override void PaintGrouped(float cx, float cy, float endX, ICanvas canvas)
        {
            var startX = cx + X;
            var width = endX - startX;
            var step = 9 * Scale * _scale;
            var loops = (int)Math.Max(1, width / step);
            var h = Renderer.Height;

            var loopX = 0f;
            for (var i = 0; i < loops; i++)
            {
                canvas.FillMusicFontSymbol(cx + X + loopX, cy + Y + h, _scale, MusicFontSymbol.WaveHorizontal);
                loopX += step;
            }
        }
开发者ID:CoderLine,项目名称:alphaTab,代码行数:15,代码来源:VibratoGlyph.cs

示例6: Paint

        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            var tabBarRenderer = (TabBarRenderer)Renderer;
            var res = Renderer.Resources;
            var startY = cy + X + (tabBarRenderer.GetNoteY(_beat.MaxNote) - res.TablatureFont.Size / 2);
            var endY = cy + Y + tabBarRenderer.GetNoteY(_beat.MinNote) + res.TablatureFont.Size / 2;
            var arrowX = (int)(cx + X + Width / 2);
            var arrowSize = 8 * Scale;

            if (_beat.BrushType != BrushType.None)
            {
                if (_beat.BrushType == BrushType.BrushUp || _beat.BrushType == BrushType.BrushDown)
                {
                    canvas.BeginPath();
                    canvas.MoveTo(arrowX, startY);
                    canvas.LineTo(arrowX, endY);
                    canvas.Stroke();
                }
                else
                {
                    var size = 15 * Scale;
                    var steps = Math.Abs(endY - startY) / size;
                    for (var i = 0; i < steps; i++)
                    {
                        canvas.FillMusicFontSymbol(cx + X + (3 * Scale), 1, startY + (i * size), MusicFontSymbol.WaveVertical);
                    }
                }

                if (_beat.BrushType == BrushType.BrushUp || _beat.BrushType == BrushType.ArpeggioUp)
                {
                    canvas.BeginPath();
                    canvas.MoveTo(arrowX, endY);
                    canvas.LineTo(arrowX + arrowSize / 2, endY - arrowSize);
                    canvas.LineTo(arrowX - arrowSize / 2, endY - arrowSize);
                    canvas.ClosePath();
                    canvas.Fill();
                }
                else
                {
                    canvas.BeginPath();
                    canvas.MoveTo(arrowX, startY);
                    canvas.LineTo(arrowX + arrowSize / 2, startY + arrowSize);
                    canvas.LineTo(arrowX - arrowSize / 2, startY + arrowSize);
                    canvas.ClosePath();
                    canvas.Fill();
                }
            }
        }
开发者ID:eriser,项目名称:alphaTab,代码行数:48,代码来源:TabBrushGlyph.cs

示例7: Paint

        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            var scoreBarRenderer = (ScoreBarRenderer)Renderer;
            var lineSize = scoreBarRenderer.LineOffset;
            var startY = cy + Y + (scoreBarRenderer.GetNoteY(_beat.MaxNote) - lineSize / 2);
            var endY = cy + Y + scoreBarRenderer.GetNoteY(_beat.MinNote) + lineSize;
            var arrowX = cx + X + Width / 2;
            var arrowSize = 8 * Scale;

            if (_beat.BrushType != BrushType.None)
            {
                if (_beat.BrushType == BrushType.ArpeggioUp || _beat.BrushType == BrushType.ArpeggioDown)
                {
                    var size = 15 * Scale;
                    var steps = Math.Abs(endY - startY) / size;
                    for (var i = 0; i < steps; i++)
                    {
                        canvas.FillMusicFontSymbol(cx + X + (3 * Scale), 1, startY + (i * size), MusicFontSymbol.WaveVertical);
                    }
                }

                if (_beat.BrushType == BrushType.ArpeggioUp)
                {
                    canvas.BeginPath();
                    canvas.MoveTo(arrowX, endY);
                    canvas.LineTo(arrowX + arrowSize / 2, endY - arrowSize);
                    canvas.LineTo(arrowX - arrowSize / 2, endY - arrowSize);
                    canvas.ClosePath();
                    canvas.Fill();
                }
                else if (_beat.BrushType == BrushType.ArpeggioDown)
                {
                    canvas.BeginPath();
                    canvas.MoveTo(arrowX, startY);
                    canvas.LineTo(arrowX + arrowSize / 2, startY + arrowSize);
                    canvas.LineTo(arrowX - arrowSize / 2, startY + arrowSize);
                    canvas.ClosePath();
                    canvas.Fill();
                }
            }
        }
开发者ID:eriser,项目名称:alphaTab,代码行数:41,代码来源:ScoreBrushGlyph.cs

示例8: Paint

        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            var res = Renderer.Resources;

            canvas.Font = res.MarkerFont;

            var textw = canvas.MeasureText("tr");
            canvas.FillText("tr", cx + X, cy + Y);

            var startX = textw;
            var endX = Width - startX;
            var step = 11 * Scale * _scale;
            var loops = Math.Max(1, ((endX - startX) / step));

            var loopX = startX;
            for (var i = 0; i < loops; i++)
            {
                canvas.FillMusicFontSymbol(cx + X + loopX, cy + Y, _scale, MusicFontSymbol.WaveHorizontal);
                loopX += step;
            }
        }
开发者ID:vmoll,项目名称:alphaTab,代码行数:21,代码来源:TrillGlyph.cs

示例9: Paint

        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            cx += X;
            cy += Y;

            var noteY = cy + Renderer.Height * 0.75f;
            canvas.Font = Renderer.Resources.EffectFont;

            canvas.FillText("(", cx, cy + Renderer.Height * 0.3f);

            var leftNoteX = cx + (10 * Scale);
            var rightNoteX = cx + (40 * Scale);

            switch (_tripletFeel)
            {
                case TripletFeel.NoTripletFeel:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full });
                    RenderBarNote(rightNoteX, noteY, NoteScale, canvas, new[] { BarType.Full });
                    break;

                case TripletFeel.Triplet8th:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full });

                    canvas.FillMusicFontSymbol(rightNoteX, noteY, NoteScale, MusicFontSymbol.Tempo);
                    canvas.FillMusicFontSymbol(rightNoteX + (NoteSeparation * Scale), noteY, NoteScale, MusicFontSymbol.NoteEighth);

                    RenderTriplet(rightNoteX, cy, canvas);
                    break;

                case TripletFeel.Triplet16th:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.Full });

                    RenderBarNote(rightNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.PartialRight });
                    RenderTriplet(rightNoteX, cy, canvas);
                    break;

                case TripletFeel.Dotted8th:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full });

                    RenderBarNote(rightNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.PartialRight });
                    canvas.FillCircle(rightNoteX + (9 * Scale), noteY, Scale);
                    break;

                case TripletFeel.Dotted16th:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.Full });

                    RenderBarNote(rightNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.Full, BarType.PartialRight });
                    canvas.FillCircle(rightNoteX + (9 * Scale), noteY, Scale);
                    break;

                case TripletFeel.Scottish8th:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full });

                    RenderBarNote(rightNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.PartialLeft,  });
                    canvas.FillCircle(rightNoteX + (NoteSeparation * Scale)+ (8 * Scale), noteY, Scale);
                    break;

                case TripletFeel.Scottish16th:
                    RenderBarNote(leftNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.Full });

                    RenderBarNote(rightNoteX, noteY, NoteScale, canvas, new[] { BarType.Full, BarType.Full, BarType.PartialLeft, });
                    canvas.FillCircle(rightNoteX + (NoteSeparation * Scale) + (8 * Scale), noteY, Scale);
                    break;
            }

            canvas.FillText("=", cx + (30 * Scale), cy + (5 * Scale));
            canvas.FillText(")", cx + (65 * Scale), cy + Renderer.Height * 0.3f);
        }
开发者ID:CoderLine,项目名称:alphaTab,代码行数:68,代码来源:TripletFeelGlyph.cs

示例10: RenderBarNote

 private void RenderBarNote(float cx, float noteY, float noteScale, ICanvas canvas, BarType[] bars)
 {
     canvas.FillMusicFontSymbol(cx, noteY, noteScale, MusicFontSymbol.Tempo);
     var partialBarWidth = (NoteSeparation / 2f) * Scale;
     for (int i = 0; i < bars.Length; i++)
     {
         switch (bars[i])
         {
             case BarType.Full:
                 canvas.FillRect(cx + (4 * Scale), noteY - (NoteHeight * Scale) + (BarSeparation * Scale * i), NoteSeparation * Scale, BarHeight * Scale);
                 break;
             case BarType.PartialLeft:
                 canvas.FillRect(cx + (4 * Scale), noteY - (NoteHeight * Scale) + (BarSeparation * Scale * i), partialBarWidth, BarHeight * Scale);
                 break;
             case BarType.PartialRight:
                 canvas.FillRect(cx + (4 * Scale) + partialBarWidth, noteY - (NoteHeight * Scale) + (BarSeparation * Scale * i), partialBarWidth, BarHeight * Scale);
                 break;
         }
     }
     canvas.FillMusicFontSymbol(cx + (NoteSeparation * Scale), noteY, noteScale, MusicFontSymbol.Tempo);
 }
开发者ID:CoderLine,项目名称:alphaTab,代码行数:21,代码来源:TripletFeelGlyph.cs

示例11: Paint

 public override void Paint(float cx, float cy, ICanvas canvas)
 {
     canvas.FillMusicFontSymbol(cx + X, cy + Y, _scale*Scale, _symbol);
 }
开发者ID:eriser,项目名称:alphaTab,代码行数:4,代码来源:MusicFontGlyph.cs


注:本文中的ICanvas.FillMusicFontSymbol方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。