我正在开发一种视频播放器,其中包括在固定容器内运行的 mplayer 小部件。我希望视频播放器的宽度和高度为固定窗格的 100%。固定窗格的左侧还有一个水平窗格。
我已经弄清楚如何获取窗口的宽度并将视频的初始大小设置为此,但我还没有弄清楚如何计算它所在的固定窗格或旁边的水平容器的大小它。
var width = -1;
var height = -1;
//1048,756 - too big
this.fixed1.ParentWindow.GetSize(out width, out height);
//would rather use this.fixed1.width or something of that sort.
//this.hpaned1 has an initial width that is auto-defined
//this.hpaned1 also contains a vpaned1
Console.WriteLine(width+","+height);
this.socket.WidthRequest = width;
this.socket.HeightRequest = height;