孤
孤星2005
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.CreateData;
var s:string;
off:integer;
len,i,j,k,n,ptr:integer;
dot_old_buff,dot_new_buff : array [0..31] of byte;
dot_asc_old, dot_asc_new : array [0..15] of byte;
//ascstr:string;
//temp,tmp:string;
begin
s := SeSkinEdit1.Text;
SetLength(DataBuf, Length(SeSkinEdit1.Text));
StrList.Clear;
len:=1;
ptr := 0;
While len<= Length(s) do
begin
if ((ord(s[len])> 127) and boolean(byte(s[len+1]) and $80)) then
begin
off:=((byte(s[len])-$a1) and $7f) * 94 + ((byte(s[len+1])-$a1) and $7f);
off :=off*32;
for i := 0 to 31 do
begin
dot_old_buff := phzk[off+i];
dot_new_buff := 0;
end;
for i:=0 to 1 do
for j:=0 to 7 do
for k:=0 to 1 do
for n:=0 to 7 do
if (dot_old_buff[i*16+j*2+k]shr (7-n)) and 1 <> 0 then
dot_new_buff[k*16+i*8+n]:= dot_new_buff[k*16+i*8+n] or ($80 shr (7-j));
SetLength(DataBuf[ptr], 32);
move(dot_new_buff, DataBuf[ptr], 32);
inc(ptr, 1);
inc(len, 2);
end
else
begin
off := byte(s[len]) * 16;
for i:=0 to 15 do
begin
dot_asc_old := pasc[off+i];;
dot_asc_new :=0;
end;
for i:=0 to 1 do
for j:=0 to 7 do
for n:=0 to 7 do
if (dot_asc_old[i*8+j]shr (7-n)) and 1 <> 0 then
dot_asc_new[i*8+n]:= dot_asc_new[i*8+n] or ($80 shr (7-j));
SetLength(DataBuf[ptr], 16);
move(dot_asc_new, DataBuf[ptr], 16);
inc(ptr, 1);
inc(len, 1);
end;
end;
converttopos;
end;
procedure TForm1.ConvertToPos;
var i,j:integer;
temp:string;
begin
showmessage(inttostr(high(databuf)));
for i:= low(DataBuf) to High(DataBuf) do
begin
for j:=low(DataBuf) to high(databuf) do begin
temp:=temp+inttohex(ord(DataBuf[i,j]),3)+'H,';
if ((j<>0) and (j mod 8 = 0)) then
temp:=temp+char(13)+char(10);
showmessage('in');
end;
temp := temp + char(13) + char(10);
end;
showmessage(temp);
end;
var s:string;
off:integer;
len,i,j,k,n,ptr:integer;
dot_old_buff,dot_new_buff : array [0..31] of byte;
dot_asc_old, dot_asc_new : array [0..15] of byte;
//ascstr:string;
//temp,tmp:string;
begin
s := SeSkinEdit1.Text;
SetLength(DataBuf, Length(SeSkinEdit1.Text));
StrList.Clear;
len:=1;
ptr := 0;
While len<= Length(s) do
begin
if ((ord(s[len])> 127) and boolean(byte(s[len+1]) and $80)) then
begin
off:=((byte(s[len])-$a1) and $7f) * 94 + ((byte(s[len+1])-$a1) and $7f);
off :=off*32;
for i := 0 to 31 do
begin
dot_old_buff := phzk[off+i];
dot_new_buff := 0;
end;
for i:=0 to 1 do
for j:=0 to 7 do
for k:=0 to 1 do
for n:=0 to 7 do
if (dot_old_buff[i*16+j*2+k]shr (7-n)) and 1 <> 0 then
dot_new_buff[k*16+i*8+n]:= dot_new_buff[k*16+i*8+n] or ($80 shr (7-j));
SetLength(DataBuf[ptr], 32);
move(dot_new_buff, DataBuf[ptr], 32);
inc(ptr, 1);
inc(len, 2);
end
else
begin
off := byte(s[len]) * 16;
for i:=0 to 15 do
begin
dot_asc_old := pasc[off+i];;
dot_asc_new :=0;
end;
for i:=0 to 1 do
for j:=0 to 7 do
for n:=0 to 7 do
if (dot_asc_old[i*8+j]shr (7-n)) and 1 <> 0 then
dot_asc_new[i*8+n]:= dot_asc_new[i*8+n] or ($80 shr (7-j));
SetLength(DataBuf[ptr], 16);
move(dot_asc_new, DataBuf[ptr], 16);
inc(ptr, 1);
inc(len, 1);
end;
end;
converttopos;
end;
procedure TForm1.ConvertToPos;
var i,j:integer;
temp:string;
begin
showmessage(inttostr(high(databuf)));
for i:= low(DataBuf) to High(DataBuf) do
begin
for j:=low(DataBuf) to high(databuf) do begin
temp:=temp+inttohex(ord(DataBuf[i,j]),3)+'H,';
if ((j<>0) and (j mod 8 = 0)) then
temp:=temp+char(13)+char(10);
showmessage('in');
end;
temp := temp + char(13) + char(10);
end;
showmessage(temp);
end;