How do I transfer JPG ask hexadecimal string, regardless of the first converts it to BMP processing
CodePudding user response:
.
Procedure TForm1. Button1Click (Sender: TObject);
Var
MS: TMemoryStream;
SHex: string;
ISize: Integer;
The begin
MS:=TMemoryStream. Create;
Try
Ms. LoadFromFile (' c: \ 1. JPG);
ISize:=Ms. Size;
Ms. Position:=0;
SetLength (sHex, iSize * 2);
//sHex which stores is conversion results
BinToHex (PChar (Ms.) Memory, PChar (sHex), iSize);
MS. The Clear;
Ms. WriteBuffer (sHex [1], the length (sHex));
Ms. SaveToFile (' c: \ 1. TXT);
The finally
MS. The Free;
end;
end;
CodePudding user response: