Main menu
Newsletter-subscribeAre you developer? Can be inform about news, updates? Can you try new versions before official presentation? Not a member yet? Please join us.
|
Draw barcode on the TCanvas, window or using device context.
Barcode studio allow draw barcode on : any TCanvas, Window or device vie device context. You can use next three procedures:
Unit : psBarcode.pas
- procedure PaintBarCode(C:TCanvas; R:TRect; E:TpsCustomBarcode);
- procedure PaintBarCodeControl(WinControl:TWinControl; R:TRect; E:TpsCustomBarcode);
- procedure PaintBarCodeHandle(HWnd:THandle; R:TRect; E:TpsCustomBarcode);
These procedures draw barcode at any TCanvas or window, but if your control is overlayed with another, when control is again visible, barcode isn't repaint. Good way is place call this procedure into draw method of the control. For example for use in TContol descendand :
TmyBarcodeControl=class(TControl)
private
FBarcodeControl:TpsCustomBarcode;
protected
procedure Paint; override;
end;
....
TmyBarcodeControl.Paint;
begin
inherited;
PaintBarcode(Canvas, ClientRect, FbarcodeControl);
end;
Example print barcode
For print barcode on default printer you can use :
var R : TRect;
FBarcode : TpsCustomControl;
....
R:=Rect(300,300,600,600);
Printer.BeginDoc;
PaintBarcode(Printer.Canvas, R, FBarcode);
Printer.EndDoc;
|