Is it possible to modify the menu options in vision.VideoPlayer system object from command-line?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 30 Mag 2017
Modificato: MathWorks Support Team
il 3 Mar 2021
I am using the vision.VideoPlayer System object, and would like to make changes to menu options like “Drop frame to improve performance”, “Fit to Window”, etc. Is there a way to this programmatically, rather than using the menu bar in the Video Player window?
Risposta accettata
MathWorks Support Team
il 3 Mar 2021
Modificato: MathWorks Support Team
il 3 Mar 2021
There is no direct way for modifying the vision.VideoPlayer menu objects. However, as a workaround, you may gain access to figure handle of the object and then access the individual parameters using 'findobj'. For example, the two parameters "Drop frame to improve performance" and " Fit to Window" can be modified by executing the following commands:
1. Gain access to figure handle of the vision.VideoPlayer object
>> set(0,'showHiddenHandles','on')
>> fig_handle = gcf ;
>> fig_handle.findobj % to view all the linked objects with the vision.VideoPlayer
2. Modify and execute "Fit to Window" option.
>>ftw = fig_handle.findobj ('TooltipString', 'Maintain fit to window') % this will search the object in the figure which has the respective 'TooltipString' parameter.
>>ftw.ClickedCallback() % execute the callback linked with this object
3. Modify and toggle "Drop frame to improve performance" parameter. Note that the object can also be searched by sequentially navigating through the Children properties of the 'Playback' menu option.
>> df = fig_handle.findobj('Label', 'Dr&op Frames to Improve Performance') %The & symbol denotes accelerator key
>> df.Callback(); % This command toggles the check mark every time it is executed
More information on navigating object handles may be found in the documentation at the following links:
0 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!