From: chern on
dear sirs,
this is the coding, anyone can help me solve the error?i want after press stop will auto save the image..
-----------------------------------------------------------------------------------------------------
% --- Executes on button press in startStopCamera.
function startStopCamera_Callback(hObject, eventdata, handles)
% hObject handle to startStopCamera (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Start/Stop Camera

if strcmp(get(handles.startStopCamera,'String'),'Start Camera')
% Camera is off. Change button string and start camera.
set(handles.startStopCamera,'String','Stop Camera')
start(handles.video)



% Camera is on. Stop camera and change button string.
else set(handles.startStopCamera,'String','Start Camera')
for ctr = 1:1
img1 = getsnapshot(handles.video);
fname = ['Image' num2str(ctr)]; % make a file name
imwrite(img1, 'image.tiff');
stop(handles.video)
closepreview(handles.video)
end
----------------------------------------------------------------------------------------
From: chern on
"chern " <yj_chern(a)yahoo.com> wrote in message <hkgh4l$cpo$1(a)fred.mathworks.com>...
> dear sirs,
> this is the coding, anyone can help me solve the error?i want after press stop will auto save the image..
> -----------------------------------------------------------------------------------------------------
> % --- Executes on button press in startStopCamera.
> function startStopCamera_Callback(hObject, eventdata, handles)
> % hObject handle to startStopCamera (see GCBO)
> % eventdata reserved - to be defined in a future version of MATLAB
> % handles structure with handles and user data (see GUIDATA)
>
> % Start/Stop Camera
>
> if strcmp(get(handles.startStopCamera,'String'),'Start Camera')
> % Camera is off. Change button string and start camera.
> set(handles.startStopCamera,'String','Stop Camera')
> start(handles.video)
>
>
>
> % Camera is on. Stop camera and change button string.
> else set(handles.startStopCamera,'String','Start Camera')
> for ctr = 1:1
> img1 = getsnapshot(handles.video);
> fname = ['Image' num2str(ctr)]; % make a file name
> imwrite(img1, 'image.tiff');
> stop(handles.video)
> closepreview(handles.video)
> end
> ----------------------------------------------------------------------------------------

thank you i solve the problem ady..
 | 
Pages: 1
Prev: Baseflow MRC
Next: combining vectors