AcTools.Render.Kn5SpecificSpecial.TrackMapRenderer.Shot C# (CSharp) Method

Shot() public method

public Shot ( string outputFile ) : void
outputFile string
return void
        public virtual void Shot(string outputFile) {
            ShotMode = true;

            try {
                if (!Initialized) {
                    Initialize();
                }

                Prepare();
                Draw();
                SaveResultAs(outputFile);
            } finally {
                ShotMode = false;
            }
        }

Usage Example

Esempio n. 1
0
        public void HitabashiPark() {
            var path = Path.Combine(AcRootFinder.Find(), @"content\tracks\hitabashipark\hitabashipark.kn5");
            var output = Path.Combine(Path.GetDirectoryName(path) ?? "", "map.png");
            var ini = Path.Combine(Path.GetDirectoryName(path) ?? "", "data", "map.ini");
            if (!File.Exists(path)) {
                Debug.WriteLine("REQUIRED ASSET IS MISSING, TEST CANNOT BE DONE");
                return;
            }

            using (var renderer = new TrackMapRenderer(path) { Scale = 3.4f, Margin = 50f }) {
                renderer.Shot(output);
                renderer.SaveInformation(ini);
            }
        }