function A=chans(str1,str2,str3);
figure('position',[296 157 560 317],'Visible','on');
axes;
text(-0.15,0.48,str1,'fontsize',208);
axis off
set(gcf,'Color','w');
saveas(gcf,'abc.bmp')
close
DD=imread('abc.bmp');
Dt=DD(10:309,1:560);
if length(str1)==1;
DD=imread('abc.bmp');
Dt=DD(10:309,1:560);
Dq=Dt(1:12:end,1:14:end);
Dqnew=255*ones(size(Dq));
Dqnew(:,10:30)=Dq(:,1:21);
A=char(zeros(size(Dq)));
A(find(Dqnew==0))=str3;
A(find(Dqnew==255))=str2;
else
Dq=Dt(1:12:end,1:14:end);
A=char(zeros(size(Dq)));
A(find(Dq==0))=str3;
A(find(Dq==255))=str2;
end
文件2,文件名是:fileL1.m
% 生成面版
close all
gcfk=figure('Position',[29 51 800 664]);
h_text1=uicontrol(gcfk,'style','text',...
'unit','normalized','position',[0.55,0.75,0.05,0.03],...
'BackgroundColor','w','ForegroundColor','r',...
'string','原始字模');
h_edit1=uicontrol(gcfk,'style','edit',...
'unit','normalized','position',[0.55,0.69,0.05,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','水');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
h_text2=uicontrol(gcfk,'style','text',...
'unit','normalized','position',[0.62,0.75,0.05,0.03],...
'BackgroundColor','w','ForegroundColor','r',...
'string','背景字模');
h_edit2=uicontrol(gcfk,'style','edit',...
'unit','normalized','position',[0.62,0.69,0.05,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','水');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
h_text3=uicontrol(gcfk,'style','text',...
'unit','normalized','position',[0.69,0.75,0.05,0.03],...
'BackgroundColor','w','ForegroundColor','r',...
'string','前景字模');
h_edit3=uicontrol(gcfk,'style','edit',...
'unit','normalized','position',[0.69,0.69,0.05,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','灌');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
h_edit4=uicontrol(gcfk,'style','edit',...
'unit','normalized','position',[0.1,0.02,0.80,0.6],...
'BackgroundColor','w','ForegroundColor','black',...
'string','');
set(h_edit1,'HorizontalAlignment','left');
set(h_edit2,'HorizontalAlignment','left');
set(h_edit3,'HorizontalAlignment','left');
set(h_edit4,'HorizontalAlignment','left');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
h_text4=uicontrol(gcfk,'style','text',...
'unit','normalized','position',[0.06,0.90,0.06,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','Note:','fontsize',18);
strN='"原始字模"取一个或两个字符, "背景字模"和"前景字模"取一个字符 !';
h_text5=uicontrol(gcfk,'style','text',...
'unit','normalized','position',[0.13,0.89,0.70,0.04],...
'BackgroundColor',[0.8 0.8 0.8],'ForegroundColor','b',...
'string',strN,'fontsize',18);
文件3,文件名:fileL2.m
% 计算字符
str1=get(h_edit1,'string');
str2=get(h_edit2,'string');
str3=get(h_edit3,'string');
A=chans(str1,str2,str3);
set(h_edit4,'max',size(A,1))
set(h_edit4,'string',A)
set(h_edit4,'fontsize',8)
文件4,文件名:control_all.m
% control
fileL1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
h_push1=uicontrol(gcfk,'style','push',...
'unit','normalized','position',[0.76,0.69,0.05,0.04],...
'BackgroundColor','g','ForegroundColor','r',...
'string','造水','callback','fileL2;');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure('position',[296 157 560 317],'Visible','on');
axes;
text(-0.15,0.48,str1,'fontsize',208);
axis off
set(gcf,'Color','w');
saveas(gcf,'abc.bmp')
close
DD=imread('abc.bmp');
Dt=DD(10:309,1:560);
if length(str1)==1;
DD=imread('abc.bmp');
Dt=DD(10:309,1:560);
Dq=Dt(1:12:end,1:14:end);
Dqnew=255*ones(size(Dq));
Dqnew(:,10:30)=Dq(:,1:21);
A=char(zeros(size(Dq)));
A(find(Dqnew==0))=str3;
A(find(Dqnew==255))=str2;
else
Dq=Dt(1:12:end,1:14:end);
A=char(zeros(size(Dq)));
A(find(Dq==0))=str3;
A(find(Dq==255))=str2;
end
文件2,文件名是:fileL1.m
% 生成面版
close all
gcfk=figure('Position',[29 51 800 664]);
h_text1=uicontrol(gcfk,'style','text',...
'unit','normalized','position',[0.55,0.75,0.05,0.03],...
'BackgroundColor','w','ForegroundColor','r',...
'string','原始字模');
h_edit1=uicontrol(gcfk,'style','edit',...
'unit','normalized','position',[0.55,0.69,0.05,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','水');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
h_text2=uicontrol(gcfk,'style','text',...
'unit','normalized','position',[0.62,0.75,0.05,0.03],...
'BackgroundColor','w','ForegroundColor','r',...
'string','背景字模');
h_edit2=uicontrol(gcfk,'style','edit',...
'unit','normalized','position',[0.62,0.69,0.05,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','水');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
h_text3=uicontrol(gcfk,'style','text',...
'unit','normalized','position',[0.69,0.75,0.05,0.03],...
'BackgroundColor','w','ForegroundColor','r',...
'string','前景字模');
h_edit3=uicontrol(gcfk,'style','edit',...
'unit','normalized','position',[0.69,0.69,0.05,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','灌');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
h_edit4=uicontrol(gcfk,'style','edit',...
'unit','normalized','position',[0.1,0.02,0.80,0.6],...
'BackgroundColor','w','ForegroundColor','black',...
'string','');
set(h_edit1,'HorizontalAlignment','left');
set(h_edit2,'HorizontalAlignment','left');
set(h_edit3,'HorizontalAlignment','left');
set(h_edit4,'HorizontalAlignment','left');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
h_text4=uicontrol(gcfk,'style','text',...
'unit','normalized','position',[0.06,0.90,0.06,0.04],...
'BackgroundColor','w','ForegroundColor','r',...
'string','Note:','fontsize',18);
strN='"原始字模"取一个或两个字符, "背景字模"和"前景字模"取一个字符 !';
h_text5=uicontrol(gcfk,'style','text',...
'unit','normalized','position',[0.13,0.89,0.70,0.04],...
'BackgroundColor',[0.8 0.8 0.8],'ForegroundColor','b',...
'string',strN,'fontsize',18);
文件3,文件名:fileL2.m
% 计算字符
str1=get(h_edit1,'string');
str2=get(h_edit2,'string');
str3=get(h_edit3,'string');
A=chans(str1,str2,str3);
set(h_edit4,'max',size(A,1))
set(h_edit4,'string',A)
set(h_edit4,'fontsize',8)
文件4,文件名:control_all.m
% control
fileL1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
h_push1=uicontrol(gcfk,'style','push',...
'unit','normalized','position',[0.76,0.69,0.05,0.04],...
'BackgroundColor','g','ForegroundColor','r',...
'string','造水','callback','fileL2;');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%