基于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画图板功能的实现相关推荐
- 基于.net之仿Windows画板设计
基于.net之仿Windows画板设计 队 长:周 洋 小组成员:周寅莹 袁晓旭 江春鹏 蒋彬含 朱振宇 屈生辉 万里骏 彭子航 指导老师:余敦辉 所在班级:湖北大学计算机科学与技术2016级 摘要: ...
- 基于JavaSwing开发简单的画图板程序 课程设计 大作业源码
基于JavaSwing开发简单的画图板程序: (大作业) 开发环境: Windows操作系统 开发工具: MyEclipse+Jdk 运行效果图: 基于JavaSwing开发简单的画图板程序: ( ...
- Mac技巧之苹果电脑Mac OS X系统上,类似Windows画图板的软件paintbrush介绍与下载
from:http://www.mac52ipod.cn/post/paintbrush-Mac-OS-X-Windows-HuaTu.php PC用户可能经常用Windows自带的画图板做简单的图片 ...
- JAVA美颜相机入门(兼具图像处理和画图板功能)
美颜相机已经成为当代年轻人不可或缺的自拍神器,其具有自动美肌,完美保留细节,让照片告别模糊等功能.或许我们会觉得编写这样一个具有如此强大功能的美颜相机一定需要庞大而且复杂的代码段,其实不然,即使对于初 ...
- 仿制Windows画图板程序
仿制Windows画图板程序 控件 代码 效果图 控件 新建一个Windows窗体应用程序,将窗体Form1调整到适当大小,在窗体Form1中分别添加1个Panel.1个PictureBox和1个St ...
- 【190227】VC++ 仿Windows写的功能完备的录音机程序源代码
源码下载简介 VC++模仿Windows而写的功能完备的录音机程序,该录音机可以录制指定输入的声音,详细信息请参考源程序.编译运行时请将MP3Enc.dll文件拷贝至Debug目录中.录音程序保存文件 ...
- Qt/C++调用Windows画图板mspaint,打开指定路径的图片文件,从文件路径中提取目录名和文件名
一.先看完整的源码 #ifdef Q_OS_WIN #include <Windows.h> #pragma comment(lib, "user32.lib") #p ...
- windows画图板 ESL转RGB 实现区间渐变色
2021.6.21记载 根据数值确定渐变范围[-1,1] 主要实现红色向绿色的渐变效果 色调(E)调低偏向红色,调高偏向绿色[0-80] 饱和度(S)越高颜色越深,越低颜色越浅[0-240] 亮度(L ...
- html5画图论文结束语,基于HTML5 Canvas的画图板的设计与实现.doc
单片机论文_优秀毕业论文_毕业论文设计_毕业过关论文_毕业设计_毕业设计说明_毕业论文_单片机毕业论文_基于单片机毕业论文_毕业论文终稿_毕业论文初稿_毕业论文设计_单片机论文_本文档支持完整下载,支 ...
最新文章
- Console-算法-一个偶数总能表示为两个素数之和
- zookeeper学习笔记2
- android.os.NetWorkOnMainThreadExcetion
- 如何用Python从数据库里面获取数据?4个步骤就能轻松实现
- git常用命令_10、Git常用命令
- 谈谈对python这门课的认识_【Python公开课】1-认识Python
- linux中timer的作用,linux - linux / timer.h setup_timer()到期功能不起作用? - 堆栈内存溢出...
- jQuery做个TextBox自动完成条
- 前端开发~uni-app ·[项目-仿糗事百科] 学习笔记 ·008【首页开发】
- 静态static与方法重载
- String、StringBuffer与StringBuilder的区别
- jQuery验证框架教程
- 物流行业GPS定位应用解决方案
- Lingo基本使用方法
- WPF另类实现摄像头录像并预览
- 计算机应用中格式刷怎么用,如何连续使用格式刷【搞定手段】
- java代码楼房销售管理系统_secondHouse2 java二手房交易管理系统,针对房地产楼房销售的 Develop 272万源代码下载- www.pudn.com...
- 西工大noj(25,26)
- c语言用户态锁使用,用户态自旋锁、读写自旋锁及互斥锁
- 【Python3.6爬虫学习记录】(十三)在阿里云服务器上运行爬虫