resize
Description​
This event is fired when alphaTab was resized and is about to rerender the music notation. This event is fired when alphaTab was resized and is about to rerender the music notation. Before the re-rendering on resize the settings will be updated in the related components. This means that any changes to the layout options or other display settings are considered. This allows to implement scenarios where maybe the scale or the layout mode dynamically changes along the resizing.
- JavaScript
- C#
- Kotlin
resize: IEventEmitterOfT<ResizeEventArgs>;
IEventEmitterOfT<ResizeEventArgs> Resize { get; set; }
var resize: IEventEmitterOfT<ResizeEventArgs>
Examples​
- JavaScript
- C#
- Android
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.resize.on((args) => {
args.settings.scale = args.newWidth > 1300
? 1.5
: (args.newWidth > 800) ? 1.3 : 1;
});
var api = new AlphaTabApi<MyControl>(...);
api.Resize.On(args =>
{
args.Settings.Display.Scale = args.NewWidth > 1300
? 1.5
: (args.NewWidth > 800) ? 1.3 : 1;
});
val api = AlphaTabApi<MyControl>(...)
api.resize.on { args ->
args.settings.display.scale = args.newWidth > 1300
? 1.5
: (args.newWidth > 800) ? 1.3 : 1;
});