官术网_书友最值得收藏!

  • OpenCV 4 with Python Blueprints
  • Dr. Menua Gevorgyan Arsen Mamikonyan Michael Beyeler
  • 131字
  • 2021-06-24 16:50:01

Learning about a basic GUI layout

The most basic layout consists of only a large black panel that provides enough room to display the video feed:

        self.video_pnl = wx.Panel(self, size=(self.imgWidth, self.imgHeight))
self.video_pnl.SetBackgroundColour(wx.BLACK)

In order for the layout to be extendable, we add it to a vertically arranged wx.BoxSizer object:

        # display the button layout beneath the video stream
self.panels_vertical = wx.BoxSizer(wx.VERTICAL)
self.panels_vertical.Add(self.video_pnl, 1, flag=wx.EXPAND | wx.TOP,
border=1)

Next, we specify an abstract method, augment_layout, for which we will not fill in any code. Instead, any user of our base class can make their own custom modifications to the basic layout:

        self.augment_layout()

Then, we just need to set the minimum size of the resulting layout and center it:

        self.SetMinSize((self.imgWidth, self.imgHeight))
self.SetSizer(self.panels_vertical)
self.Centre()

The next section shows you how to handle video streams.

主站蜘蛛池模板: 大竹县| 松桃| 雷波县| 肇东市| 收藏| 张家口市| 青河县| 玉田县| 大余县| 尼勒克县| 商水县| 镇安县| 桃江县| 古丈县| 平塘县| 玉屏| 察隅县| 康乐县| 崇文区| 高邑县| 阳山县| 河源市| 玉屏| 芒康县| 恩平市| 扎赉特旗| 凉城县| 丹东市| 平利县| 兰西县| 富平县| 襄汾县| 蒲城县| 潜山县| 大安市| 武邑县| 瓮安县| 汝阳县| 康乐县| 扎兰屯市| 东方市|