首 页文档资料下载资料维修视频包年699元
请登录  |  免费注册
当前位置:精通维修下载 > 文档资料 > 电子技术 > 光电应用
点阵式液晶任意图片显示的实现
来源:本站整理  作者:佚名  2009-12-24 14:46:58



   windows中的画图软件为图片编辑提供了放大、网格、旋转、定位、定幅等强大、实用而灵活的功能,同时有输入各种字体及大小的汉字的功能,是编辑画面的理想工具。打开菜单[图像]下的[属性]项,设置任意图片宽度为128,高度为64,单位为像素,颜色为黑白。保存的bmp文件经过下面 delphi编写的函数s_copyfile()便可转换为lcd模块显示的点阵数据,数据以单片机数据表定义的格式放在memo1中,可以直接拷贝至 lcm控制汇编程序中当数据表用,如图3所示。另外使用了heckbox1控件来使图片反白。

函数s_copyfile()的源程序如下[4]:
function s_copyfile(filesou:string;filedes:string):boolean;
var
fromf, tof: file;
s,t:string;
i,j,numread, numwritten: integer;
tem: array[1..62] of char;
buf: array[1..16] of char;
begin
{$i-}
s_copyfile:=false;
if not fileexists(filesou) then
begin
showmessage(没有发现源文件+#13+filesou);
exit;
end;
assignfile(fromf,filesou);
assignfile(tof,filedes);
reset(fromf,1);{ record size = 1 }
main.memo1.clear;
main.memo3.clear;
blockread(fromf, tem, sizeof(tem), j);
j:=1;
repeat
s:= db ;
t:=;
blockread(fromf, buf, sizeof(buf), numread);
for i:=1 to numread do
begin
if main.checkbox1.checked then buf[i]:=chr
(255-ord(buf[i]));
appendstr(t,inttohex(ord(buf[i]),2));
if ord(buf[i])>159 then
appendstr(s,0+inttohex(ord(buf[i]),2)
+h,)
else
appendstr(s,inttohex(ord(buf[i]),2)
+h,);
end;
delete(s,length(s),1);
main.memo1.lines.append(s);
main.memo3.lines.append(t);
inc(j);
until (numread = 0);
main.memo1.lines.delete(main.memo1.lines.
capacity-1);
closefile(fromf);
closefile(tof);
s_copyfile:=true;
end;
lcd模拟显示


上一页  [1] [2] [3] 

关键词:

文章评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分)

推荐阅读

图文阅读

热门阅读

Copyright © 2007-2017 down.gzweix.Com. All Rights Reserved .
页面执行时间:100,023.40000 毫秒