本文整理汇总了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);
}
示例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));
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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();
}
}
}
示例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();
}
}
}
示例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;
}
}
示例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);
}
示例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);
}
示例11: Paint
public override void Paint(float cx, float cy, ICanvas canvas)
{
canvas.FillMusicFontSymbol(cx + X, cy + Y, _scale*Scale, _symbol);
}