Changeset 831 for trunk


Ignore:
Timestamp:
Nov 30, 2014, 11:20:17 PM (10 years ago)
Author:
sommeria
Message:

movie export improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r827 r831  
    652652end
    653653figure_movie=figure;
    654 nbpix=[512 384];% resolution XVGA
     654nbpix=[640 480];% resolution VGA
    655655set(figure_movie,'name','figure_movie','Position',[1 1 nbpix])
    656656newaxes=copyobj(handles.PlotAxes,figure_movie);%new plotting axes in the new figure
     
    660660time_str=get(handles.TimeValue,'String');
    661661if ~isempty(time_str)
    662     htitle=get(newaxes,'Title');
    663 %     xlim=get(newaxes,'XLim');
    664 %     ylim=get(newaxes,'YLim');
    665 %     set(htitle,'Position',[xlim(2)+0.07*(xlim(2)-xlim(1)) ylim(2)-0.05*(ylim(2)-ylim(1)) 0])
    666    
     662    htitle=get(newaxes,'Title'); 
    667663    set(htitle,'String',['t=' time_str])
    668664end
     
    689685uicontrol('Style','edit','Units','normalized', 'Position', [0.05 0.95-1.5*hh 0.9 hh],'tag','MovieName','BackgroundColor',[1 1 1],...
    690686    'String',fullfile(RootPath,[SubDir '.movie'], [RootFile '.avi']),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''MovieName'': name (with path) of the movie to create');%edit box
    691 uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.95-2.5*hh 0.45 hh/2],'BackgroundColor',BackgroundColor,...
     687uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.95-2.5*hh 0.33 hh/2],'BackgroundColor',BackgroundColor,...
    692688    'String','frames per second:','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
    693 uicontrol('Style','text','Units','normalized', 'Position', [0.55 0.95-2.5*hh 0.45 hh/2],'BackgroundColor',BackgroundColor,...
     689uicontrol('Style','text','Units','normalized', 'Position', [0.3 0.95-2.5*hh 0.33 hh/2],'BackgroundColor',BackgroundColor,...
     690    'String','resolution:','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
     691uicontrol('Style','text','Units','normalized', 'Position', [0.55 0.95-2.5*hh 0.33 hh/2],'BackgroundColor',BackgroundColor,...
    694692    'String','total nbre of frames:','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
    695693uicontrol('Style','edit','Units','normalized', 'Position', [0.05 0.95-3.5*hh 0.3 hh],'tag','num_FramePerSecond','BackgroundColor',[1 1 1],...
    696694    'String','10','FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_FramePerSecond'': nbre of frames per second');%edit box
     695
     696uicontrol('Style','listbox','Units','normalized', 'Position', [0.35 0.15 0.3 3*hh],'tag','MovieSize','BackgroundColor',[1 1 1],...
     697    'Callback',@(hObject,eventdata)set_movie_size_Callback(hObject,eventdata),'String',{'640x480(VGA)';'720x480(mpeg2 16/9)';'1280x720(HD)'},...
     698    'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''MovieSize'': resolution of the movie');%menu
     699
    697700uicontrol('Style','edit','Units','normalized', 'Position', [0.65 0.95-3.5*hh 0.3 hh],'tag','num_FrameNumber','BackgroundColor',[1 1 1],...
    698701    'String','10','FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_FrameNumber'': total nbre of frames');%edit box
     702
    699703uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.05 0.15 0.25 hh],'BackgroundColor',[1 0 0],'String','START','Callback',@(hObject,eventdata)set_movie_START_Callback(hObject,eventdata),...
    700704    'FontWeight','bold','FontUnits','points','FontSize',12,'TooltipString','''APPLY'': apply the output to the current field series in uvmat');
     
    706710
    707711%------------------------------------------------------------------------
    708 % function called by pressing APPLY in the GUI  set_slices
     712% function called by selecting movie size in the GUI  set_movie
     713function set_movie_size_Callback(hObject,eventdata)
     714hset_movie=get(hObject,'parent');
     715hMovieSize=findobj(hset_movie,'Tag','MovieSize');
     716nbpix=[640 480; 720 480; 1280 720];
     717SizeOption=get(hMovieSize,'Value');   
     718nbpix=nbpix(SizeOption,:); 
     719   
     720%% look for movie fig
     721figure_movie=findobj(allchild(0),'name','figure_movie');
     722if isempty(figure_movie)
     723    figure_movie=figure;
     724    set(figure_movie,'name','figure_movie','Position',[1 1 nbpix])
     725    huvmat=findobj(allchild(0),'tag','uvmat');
     726    hhuvmat=guidata(huvmat);
     727    newaxes=copyobj(hhuvmat.PlotAxes,figure_movie);%new plotting axes in the new figure
     728    set(newaxes,'Tag','movieaxes')
     729   
     730    %% display time if defined in uvmat
     731    time_str=get(hhuvmat.TimeValue,'String');
     732    if ~isempty(time_str)
     733        htitle=get(newaxes,'Title');
     734        set(htitle,'String',['t=' time_str])
     735    end
     736    map=colormap(handles.PlotAxes);
     737    colormap(map);%transmit the current colormap to the zoom fig
     738    colorbar
     739else
     740    Pos=get(figure_movie,'Position');
     741    set(figure_movie,'Position',[Pos(1) Pos(2) nbpix])
     742end
     743
     744
     745%------------------------------------------------------------------------
     746% function called by pressing APPLY in the GUI  set_movie
    709747function set_movie_START_Callback(hObject,eventdata)
    710748%------------------------------------------------------------------------   
Note: See TracChangeset for help on using the changeset viewer.