private double DrawFrettedNote(IGenericDrawingSurface g, int numString, int timePos, int numFret, Note note, double previousNoteXPos, double groupNoteSpacing)
        {
            double vspacing = 3;

            //calc position of this note, based on end of previous note
            double xNotePos = measureX + groupNoteSpacing;

            double noteDisplayWidth = GetNoteDisplayWidth(note, groupNoteSpacing);

            //if previous note drawn in measure, start from there
            if (previousNoteXPos > measureX)
            {
                xNotePos = previousNoteXPos;
            }

            double yNotePos = (measureY + (numString * stringSpacing));// -(fontSize * 0.5);

            //draw masking rectangle behind text to improve readability
            double notationWidth = (numFret.ToString().Length *(fontSize * 0.75));

            g.FillRectangle(xNotePos, yNotePos + (fontSize * 0.5), notationWidth, (fontSize), ColorPreset.Background, ColorPreset.Background);

            //draw fret number on string
            g.DrawString(xNotePos, yNotePos + (fontSize * 0.5), numFret.ToString(), fontSize);

            //draw notations
            if (note.Notations != null)
            {
                //draw slur start
                if (note.Notations.IsSlurStart)
                {
                    g.DrawArc(xNotePos + vspacing, yNotePos - vspacing, groupNoteSpacing, true);
                }

                if (note.Notations.IsSlideStart)
                {
                    g.DrawLine((xNotePos + fontSize), (yNotePos + fontSize), (xNotePos + groupNoteSpacing), (yNotePos + fontSize), 2, ColorPreset.Foreground);
                }

                if (note.Notations.Technical.IsVibrato)
                {
                    double x1            = xNotePos + vspacing;
                    double y1            = measureY - STANDARD_STRINGSPACING;
                    string vibratoString = "~";

                    for (int i = 0; i < note.Duration; i++)
                    {
                        vibratoString += "~";
                    }

                    g.DrawString(x1, y1, vibratoString, STANDARD_FONTSIZE * 2);
                }
            }

            xNotePos += noteDisplayWidth;
            return(xNotePos);
        }
        public override void Render(IGenericDrawingSurface canvas)
        {
            if (EnableRendering == false)
            {
                return;
            }

            //select and init rendering surface type
            IGenericDrawingSurface g = InitialiseDrawingSurface(canvas);

            int numberOfStrings = _guitarModel.GuitarModelSettings.CurrentTuning.NumberStrings;
            int numberFrets     = _guitarModel.GuitarModelSettings.NumberFrets;

            int startX = PaddingLeft;
            int startY = PaddingTop;

            _noteList = new List <NoteItem>();

            ColorValue defaultCanvasFontColor = ColorPalette[ThemeColorPreset.Foreground];

            int fboardWidth = GuitarString.FretNumberToClientX(_guitarModel.GuitarModelSettings.NumberFrets, _guitarModel, 0);

            int fboardHeight = _guitarModel.GuitarModelSettings.StringSpacing * (numberOfStrings - 1);

            if (_guitarModel.GuitarModelSettings.EnableFretboardBackgroundFill)
            {
                // optional background fretboard fill
                g.FillRectangle(startX, startY + _guitarModel.GuitarModelSettings.StringSpacing, fboardWidth, fboardHeight, ColorPalette[ThemeColorPreset.Background], ColorPalette[ThemeColorPreset.Subtle]);
            }

            //draw frets..
            DrawFrets(numberOfStrings, g, startX, startY);

            //draw strings (and note markers)..
            startY = PaddingTop + (_guitarModel.GuitarModelSettings.StringSpacing * numberOfStrings);
            startY = DrawGuitarStrings(numberOfStrings, g, PaddingLeft, startY);

            //draw fret numbers
            if (_guitarModel.GuitarModelSettings.EnableFretNumbers)
            {
                startX = PaddingLeft;
                startY = PaddingTop + 5 + _guitarModel.GuitarModelSettings.StringSpacing * (numberOfStrings);

                DrawFretNumbers(numberFrets, g, startX, startY, defaultCanvasFontColor);
            }

            //show scale intervals & notes
            var scale = _guitarModel.SelectedScale;

            DrawScaleFormulaIntervals(g, PaddingLeft + 4, startY, scale, defaultCanvasFontColor);
            DrawScaleNoteList(g, PaddingLeft + 4, startY, scale, defaultCanvasFontColor);

            if (IsExportMode)
            {
                //draw copyright/watermark (for exported images)
                g.DrawString(PaddingLeft + 5, startY + 10, "Generated by Guitar Toolkit - Copyright " + System.DateTime.Now.Year + " Soundshed.com");
            }

            startX = 0;
            startY = 10;

            //draw scale title
            if (_guitarModel.GuitarModelSettings.EnableDiagramTitle)
            {
                var title = _guitarModel.GetDiagramTitle();
                g.DrawString(startX, startY, title, 8, defaultCanvasFontColor);
            }
        }