如何写文本文件,你应该会,其他我写在下面。
function JpegToTxt(FileName: String):integer;
var
F: file;
Size,i: Integer;
BytesReaded: Integer;
c: Char;
Buffer: Pchar;
begin
AssignFile(F, FileName);
FileMode := 0; //Set file access to read only
Reset(F,1);
try
Size := FileSize(F);
GetMem(Buffer, Size);
try
BlockRead(F, Buffer^, Size, BytesReaded);
for i:=0 to size-1 do
begin
c := Buffer; //c就是图象文件的每个字节
......
将其用十六进制存入文本文件即可。
......
end;
finally
FreeMem(Buffer);
end;
finally
CloseFile(F);
end;
end;