日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

基于MATLAB的仿windows画图板功能的实现

發布時間:2025/4/5 windows 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 基于MATLAB的仿windows画图板功能的实现 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.仿真預覽

2.部分核心代碼

% --- Executes on selection change in popupmenu2. function popupmenu2_Callback(hObject, eventdata, handles) % hObject handle to popupmenu2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns popupmenu2 contents as cell array % contents{get(hObject,'Value')} returns selected item from popupmenu2 global rgb; str=get(handles.popupmenu2,'string'); index=get(handles.popupmenu2,'value'); str1=char(str(index)); switch (str1)case 'red'rgb=[1,0,0];case 'green'rgb=[0,1,0];case 'blue'rgb=[0,0,1];case 'black'rgb=[0,0,0]; end set(handles.edit1,'foregroundcolor',rgb); set(handles.edit2,'foregroundcolor',rgb); set(handles.text3,'foregroundcolor',rgb); % --- Executes during object creation, after setting all properties. function popupmenu2_CreateFcn(hObject, eventdata, handles) % hObject handle to popupmenu2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white'); end% --- Executes on mouse press over axes background. function axes1_ButtonDownFcn(hObject, eventdata, handles) % hObject handle to axes1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)% --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % set(gcf, 'Interruptible', 'off','BusyAction', 'cancel'); % set(gcf, 'WindowButtonMotionFcn', '','Interruptible', 'off'); cla set(handles.edit1,'string',''); set(handles.edit2,'string',''); set(handles.text3,'string',''); set(handles.pushbutton2,'enable','off'); set(handles.pushbutton3,'enable','off'); % --- Executes on button press in pushbutton3. function pushbutton3_Callback(hObject, eventdata, handles) % hObject handle to pushbutton3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) [FileName,PathName] = uiputfile({'*.jpg','JPEG(*.jpg)';...'*.bmp','Bitmap(*.bmp)';...'*.gif','GIF(*.gif)';...'*.*', 'All Files (*.*)'},...'Save Picture','Untitled'); if FileName==0return; elseh=getframe(handles.axes1);imwrite(h.cdata,[PathName,FileName]); end% --- Executes on button press in pushbutton4. function pushbutton4_Callback(hObject, eventdata, handles) % hObject handle to pushbutton4 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) CleanGlobals; close(gcf);% --- Executes on selection change in popupmenu3. function popupmenu3_Callback(hObject, eventdata, handles) % hObject handle to popupmenu3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns popupmenu3 contents as cell array % contents{get(hObject,'Value')} returns selected item from popupmenu3 global graph flag h mark; h=[]; str=get(handles.popupmenu3,'string'); index=get(handles.popupmenu3,'value'); graph=char(str(index)); popu={}; switch(graph)case '點線'popu={'. 點';'+ 號';'O 圈';'* 號';'v 三角號'};set(handles.popupmenu1,'string',popu);set(handles.popupmenu1,'value',1);set(handles.text4,'string','選擇marker')mark='.';otherwisepopu={'- 實線';'--虛線';': 點線';'-.虛點線';};set(handles.popupmenu1,'string',popu);set(handles.popupmenu1,'value',1);set(handles.text4,'string','選擇LineTyple')mark='-'; end

C-02

總結

以上是生活随笔為你收集整理的基于MATLAB的仿windows画图板功能的实现的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。