Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-12

how to Draw Data Matrix by TLazBarcode

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

최경식

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151215/7724c2cf/attachment.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: abnormal.PNG
Type: image/png
Size: 1341 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151215/7724c2cf/attachment.png> -------------- next part --------------
A non-text attachment was scrubbed...
Name: Normal.PNG
Type: image/png
Size: 1185 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151215/7724c2cf/attachment-0001.png>

Reply by email

José Mejuto
to 최경식

El 15/12/2015 a las 10:28, ??? escribi?:

Show quoted text 13 lines
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 ErrorCode0 then begin
       FLastErrorString:=FQR^.errtxt;
       exit;
     end;
   end;
end;
--------------------------

Note the "option_3" as DM_SQUARE setting.

Reply by email

최경식
to José Mejuto
Earlier message 69 lines
-----Original Message----- From: "Jos? Mejuto"&lt;&gt; To: &lt;&gt;; Cc: Sent: 2015-12-16 (?) 00:14:02 Subject: Re: [Lazarus] how to Draw Data Matrix by TLazBarcode El 15/12/2015 a las 10:28, ??? escribi?: &gt; i use lazarus 1.0.10 ver. &gt; &gt; i want to Draw Data Matrix 2D Barcode. &gt; &gt; so i used TLazBarcode Component, but it dosen't draw well. &gt; &gt; Data Matrix Format is variable when increase Data Matrix data. &gt; &gt; how to fix Data Matrix Format? &gt; &gt; i attach two picture. &gt; &gt; thank you &gt;Hello, &gt;Both Datamatrix are OK and well formed, unfortunatly there are many &gt;options to generate some barcodes and I was unable to add much of them &gt;due lack of time and there is no much people using the package and &gt;maintain it is not, by now, a priority to me. &gt;In order to generate the DataMatrix as you like it, squared, please open &gt;the package source file "ubarcodes.pas", look for "procedure &gt;TBarcodeDataMatrix.Generate" and change the function by this one: --------------------------- &gt;procedure TBarcodeDataMatrix.Generate; &gt;var &gt;ErrorCode: integer; &gt;begin &gt;if Assigned(FQR) then begin &gt;ZBarcode_Delete(FQR); &gt;FQR:=nil; &gt;end; &gt;if Length(FText)&gt;0 then begin &gt;FQR:=ZBarcode_Create(); &gt;with FQR^ do begin &gt;border_width:=1; &gt;option_3:=DM_SQUARE; &gt;end; &gt;ErrorCode:=dmatrix(FQR, at FText[1],Length(FText)); &gt;if ErrorCode&lt;&gt;0 then begin &gt;FLastErrorString:=FQR^.errtxt; &gt;exit; &gt;end; &gt;end; &gt;end; -------------------------- &gt;Note the "option_3" as DM_SQUARE setting. Thank you for your answer. I solve this problem. I'm so so so appreciate. But I have one more problem. How to change Data Matrix width and Height. if you know any way, please share me. Thank you.

Reply by email

José Mejuto
to 최경식

El 16/12/2015 a las 1:22, ??? escribi?:

Show quoted text 6 lines
Thank you for your answer. I solve this problem. I'm so so so appreciate. But I have one more problem. How to change Data Matrix width and Height. if you know any way, please share me.

Hello,

Can you be more precise ? Which kind of width & height ? With StrictSize checked the widget size would be 1x, 2x, 3x,...,Nx to fill as much as possible of the print space keeping pixels exactly as expected by the format so no "half pixel" dots appears. Non StrictSize can be used if the generated image would be big enought that non expected pixels (lines, "half pixel") will not affect the read capability (usually bigger than 4x original size).

Reply by email