This public class contains central definitions for controlling the visual appearance.
Esempio n. 1
0
        public void Invalidate()
        {
            if (Settings.Width == 0)
            {
                Logger.Warning("Rendering", "AlphaTab skipped rendering because of width=0 (element invisible)");
                return;
            }
            BoundsLookup = new BoundsLookup();
            if (Tracks.Length == 0)
            {
                return;
            }

            RecreateCanvas();
            if (RenderingResources.Scale != Settings.Scale)
            {
                RenderingResources.Init(Settings.Scale);
                Canvas.LineWidth = Settings.Scale;
            }
            Canvas.Resources = RenderingResources;

            OnPreRender();
            RecreateLayout();
            LayoutAndRender();
            _renderedTracks = Tracks;
            Logger.Info("Rendering", "Rendering finished");
        }
Esempio n. 2
0
 public ScoreRenderer(Settings settings)
 {
     Settings           = settings;
     RenderingResources = new RenderingResources(1);
     RecreateCanvas();
     RecreateLayout();
 }
Esempio n. 3
0
 public ScoreRenderer(Settings settings, object param)
 {
     Settings           = settings;
     RenderingResources = new RenderingResources(1);
     if (settings.Engine == null || !Environment.RenderEngines.ContainsKey(settings.Engine))
     {
         Canvas = Environment.RenderEngines["default"](param);
     }
     else
     {
         Canvas = Environment.RenderEngines[settings.Engine](param);
     }
     RecreateLayout();
 }
Esempio n. 4
0
 public ScoreRenderer(Settings settings)
 {
     Settings = settings;
     RenderingResources = new RenderingResources(1);
     if (settings.Engine == null || !Environment.RenderEngines.ContainsKey(settings.Engine))
     {
         Canvas = Environment.RenderEngines["default"]();
     }
     else
     {
         Canvas = Environment.RenderEngines[settings.Engine]();
     }
     RecreateLayout();
 }
 public void Invalidate()
 {
     if (Tracks.Length == 0)
     {
         return;
     }
     if (RenderingResources.Scale != Settings.Scale)
     {
         RenderingResources.Init(Settings.Scale);
         Canvas.LineWidth = Settings.Scale;
     }
     Canvas.Resources = RenderingResources;
     OnPreRender();
     RecreateLayout();
     LayoutAndRender();
 }