- 主要是因为自己在破解录屏软件的时候弄了好久没安装成功,所以就想着直接用MATLAB写一个小工具来辅助自己,程序不难,主要就是一个使用timer定时获取截图并拼接成gif格式的图片,然后可以指定录屏的大小,这个通过一个调整一个figure的大小来完成,需要了解的知识点就是Java类的使用,稍微查查就明白了。
需要保存三张图片,分别命名为play.jpg,pause.jpg,stop,jpg。
效果如下:
import java.awt.Robot
import java.awt.Rectangle
close all
%% GUI 初始化
homePage = figure('units','pixels','tag','homePage','position',[30 600 150 60],...
'NumberTitle','off','menubar','none','toolbar','none','resize','off',...
'DeleteFcn',@delete_timer);
playButton = uicontrol('parent',homePage,'units','pixels','position',...
[35 0 20 20],'style','pushbutton','callback',@play_pause,'tag','playButton');
stopButton = uicontrol('parent',homePage,'units','pixels','position',...
[120 0 20 20],'style','pushbutton','callback',@stopfcn,'tag','stopButton');
startText = uicontrol('parent',homePage,'units','pixels','style','text',...
'position',[0 0 30 15],'string','Start:','fontWeight','bold',...
'HorizontalAlignment','left');
stopText = uicontrol('parent',homePage,'units','pixels','style','text',...
'position',[90 0 30 15],'string','Stop:','fontWeight','bold',...
'HorizontalAlignment','left');
timingText = uicontrol('parent',homePage,'units','pixels','style','text',...