Kali ini mari kita buat program untuk meng-konversi kode barcode menjadi file gambar (jpg,bmp, dll) atau langsung di print.
Syarat yang diperlukan:
- Delphi 7
- Komponent AsBarcode (thanks to: Andreas Schmidt and friends)
- TextAnimator (optional)
Let do it:
1. Tempatkan komponens FBarcode, TEdit, TLabel, TImage, TSavePictureDialog, TFontDialog, TButton, TUpDown, seperti pada gambar 1.
2. Ketikan kode berikut pada Event OnCreate dari Form1:
procedure TMainForm.FormCreate(Sender: TObject);
begin
cMessage.Active := True;
cAnimator.Active := True;
ComboBox1.ItemIndex := 14;
ComboBox2.ItemIndex:= 1;
ComboBox3.ItemIndex:= 5;
Barcode1.Top := 0;
Barcode1.Left := 0; //Barcode1.Typ := TBarcodeType(ComboBox1.ItemIndex);
Barcode1.ShowText := TBarcodeOption(ComboBox2.ItemIndex);
Barcode1.ShowTextPosition := TShowTextPosition(ComboBox3.ItemIndex);
BarCode1.Text := Edit1.Text;
end;
lanjut ke halaman berikutnya ya