Home > Back-end >  Delphi 64 digits 8 byte array into a string?
Delphi 64 digits 8 byte array into a string?

Time:09-16

Delphi 64 digits 8 byte array into a string?

CodePudding user response:

According to the area of the qr code as 64 x64 pixels, and displayed in the center, each point with a said, 0 means scotoma, 1 window,
Every line of 64, a total of 8 bytes, said a total of 64 lines, byte on the left is high, on the right is low,
Send the whole screen dot matrix data need 64 * 8=512 bytes, at a time

CodePudding user response:

 
//ACanvas to qr code drawing control, OrgPt for qr code in the upper left corner coordinates
Procedure EncodeQRData (ACanvas: TCanvas; OrgPt: TPoint; PResult: Pointer);
Const
ZQRBright: TColor=clWhite;
Var
P: PDWORD;
M: dwords.
I, X, Y: Integer;
The begin
P:=pResult;
For: Y=OrgPt. Y to (OrgPt. Y + 63) do the begin
X:=OrgPt. X;
For I:=0 to 1 do begin
M:=$80000000;
P ^ :=0;
Repeat
If ACanvas. Pixels (X, Y)=zQRBright then begin
P=P ^ ^ : or M;
end;
Inc (X);
M:=1 M SHR;
Until M=0;
Inc (P);
end;
end;
end;
  • Related