Fix a warning message of keyword  'Take Screenshot' when using wxPython 4
Use `wx.Bitmap`, not deprecated `wx.EmptyBitmap`, with wxPython 4+. Cannot always use `wx.Bitmap` because it's not compatible with older wxPython versions.
Fixes
@@ -346,6 +346,9 @@ class ScreenshotTaker(object):
self._wx_app_reference = wx.App(False)
context = wx.ScreenDC()
width, height = context.GetSize()
+ if wx.__version__ >= '4':
+ bitmap = wx.Bitmap(width, height, -1)
+ else:
bitmap = wx.EmptyBitmap(width, height, -1)
memory = wx.MemoryDC()
memory.SelectObject(bitmap)
