Add ActiveBarcode to the Delphi development environment
(The is also a description for older Delphi versions (4-7) available)
Select a package in which you would like to take up the Control or create a new package ("File" - "New" - "Package Delphi for Win32 "):

Now import the ActiveBarcode Control in the package. Launch the function "Component import" from the menu "Component".



Select "ActiveBarcode" from that list and click "Continue". A page for compontent setup will be shown:




Use ActiveBarcode (Example)
Create a new project: "File" - "New" - "Form application VCL". To place ActiveBarcode now onto a form you select the ActiveBarcodeControl from the tool palette. You'll find this under "ActiveX" as a "TBarcode" component:


For this example add one more TEdit to the form. Now you form might look as follows:



Change the content of the edit field to change the barcode.
Programming:
Setting properties is very simple. Some examples:
Barcode1.Text := '123456789012';Using the Picture Property:
Barcode1.BackColor := clWhite;
Barcode1.ForeColor := clBlack;
Copy the barcode to a image object:
Image1.Picture.Bitmap.Height := Barcode1.Height;Clipboard:
Image1.Picture.Bitmap.Width := Barcode1.Width;
Barcode1.Picture.PictureAdapter := nil; // delphi workaround
Image1.Picture.Bitmap.Canvas.Draw(0,0,Barcode1.Picture.graphic);
Copy the current barcode to the clipboard. Metafile (WMF):
Barcode1.CopyToClipboard;Bitmap:
Image1.Picture.Bitmap.Height := Barcode1.Height;
Image1.Picture.Bitmap.Width := Barcode1.Width;
Barcode1.Picture.PictureAdapter := nil; // delphi workaround
Image1.Picture.Bitmap.Canvas.Draw(0,0,Barcode1.Picture.graphic);
Clipboard.Assign(Image1.Picture.Bitmap);
No comments:
Post a Comment