Exemple #1
0
        private void RenderLines()
        {
            var lines = Map.Trim().Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries);
            var world = new Map(lines);

            var camera = new Camera(world.CameraLocation, world)
            {
                DirectionInDegrees = DirectionInDegrees
            };
            var renderer = new BitmapRenderer(Height, Width);
            var result   = camera.Snapshot(renderer.Width, true);
            var pixels   = renderer.RenderBitmap(result.Columns, camera);

            var jpegByteArray = JpegSaver.SaveToJpeg(pixels);

            ImageBytesBase64 = Convert.ToBase64String(jpegByteArray);
        }