hi,
I am using MediaCtrl in a small video-tracking project. It is based on the MediaCtrl demo in the wxPython docs with only slight mods. What it does is to create an instance of MediaCtrl with defaults and the parent is a wx.Window that is within a wx.Frame. I then create a device context as follows:
self.mc.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
def OnRightDown(self, evt):
dc = wx.WindowDC(self.mc)#self.mc is the MediaCtrl
dc.SetBackground(wx.TRANSPARENT_BRUSH)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
print “Colour is :”,dc.GetPixel(evt.GetX(),
evt.GetY())
I have encountered the following problems:
1)For the program to get the correct pixel value, I have to first open Windows Media Player and start the video there. Otherwise, the colour gotten is ALWAYS (16,0,16).
2)When I move the Frame while the video is paused, the MediaCtrl is left behind such that moving the frame results in only a part of the video being seen (if I move the frame further, I don’t even see any part of the video). This also does not happen if WMP is open and playing the video.
3)I have been unable to scale the MediaCtrl so that it fits exactly in the wx.Window whose size is set to (500,400)
4)I want the slider used for seeking to be enabled immediately the video is loaded such that I use the slider to select where I want the video to start playing before clicking on the play button.
please help me out here. The program is giving me sleepless nights! My box a Cyrix clone with cpu speed of 800Hz (though I dont think this is an issue. I have tried the prog on different computers with the same outcome). I am using wxPython version 2.6.3.3 on Python 2.4. Platform is Windows 2000.