[Lazarus] how to Draw Data Matrix by TLazBarcode

José Mejuto joshyfun at gmail.com
Tue Dec 15 16:14:02 CET 2015


El 15/12/2015 a las 10:28, 최경식 escribió:
> i use lazarus 1.0.10 ver.
>
> i want to Draw Data Matrix 2D Barcode.
>
> so i used TLazBarcode Component, but it dosen't draw well.
>
> Data Matrix Format is variable when increase Data Matrix data.
>
> how to fix Data Matrix Format?
>
> i attach two picture.
>
> thank you

Hello,

Both Datamatrix are OK and well formed, unfortunatly there are many 
options to generate some barcodes and I was unable to add much of them 
due lack of time and there is no much people using the package and 
maintain it is not, by now, a priority to me.

In order to generate the DataMatrix as you like it, squared, please open 
the package source file "ubarcodes.pas", look for "procedure 
TBarcodeDataMatrix.Generate" and change the function by this one:

---------------------------
procedure TBarcodeDataMatrix.Generate;
var
   ErrorCode: integer;
begin
   if Assigned(FQR) then begin
     ZBarcode_Delete(FQR);
     FQR:=nil;
   end;
   if Length(FText)>0 then begin
     FQR:=ZBarcode_Create();
     with FQR^ do begin
       border_width:=1;
       option_3:=DM_SQUARE;
     end;
     ErrorCode:=dmatrix(FQR, at FText[1],Length(FText));
     if ErrorCode<>0 then begin
       FLastErrorString:=FQR^.errtxt;
       exit;
     end;
   end;
end;
--------------------------

Note the "option_3" as DM_SQUARE setting.

-- 





More information about the Lazarus mailing list