void HandleSizeChange(object o, SizeChangeArgs args) { Stage stage = Stage.Default; int new_x = 0; int new_y = 0; int new_width = 0; int new_height = (args.Height * (int)stage.Width) / args.Width; if (new_height <= stage.Height) { new_width = (int)stage.Width; new_x = 0; new_y = ((int)stage.Height - new_height) / 2; } else { new_width = (args.Width * (int)stage.Height) / args.Height; new_x = ((int)stage.Width - new_width) / 2; new_y = 0; } vtexture.SetPosition(new_x, new_y); vtexture.SetSize(new_width, new_height); }
private void OnVideoTextureSizeChange(object o, SizeChangeArgs args) { AllocateVideoTexture (args.Width, args.Height); }
void HandleSizeChange(object o, SizeChangeArgs args) { Stage stage = Stage.Default; int new_x = 0; int new_y = 0; int new_width = 0; int new_height = (args.Height * (int)stage.Width) / args.Width; if (new_height <= stage.Height) { new_width = (int)stage.Width; new_x = 0; new_y = ((int)stage.Height - new_height) / 2; } else { new_width = (args.Width * (int)stage.Height) / args.Height; new_x = ((int)stage.Width - new_width) / 2; new_y = 0; } vtexture.SetPosition (new_x, new_y); vtexture.SetSize (new_width, new_height); }