FoxBarcode使用教程
FoxBarcode是100%的VFox类,它提供了一个使用不同条码特征生成图像文件的工具,它应用于VFP表单和报告,或出口到其他应用程序。
Project Manager: VFPEncoding (*)
(*) VFPEncoding are Guillermo Carrero (RIP) (Barcelona, Spain) and Luis Maria Guayan (Tucuman, Argentina)
In Memoriam Guillermo Carrero (Feb 05, 1961 / Jan 14, 2013)
特性
FoxBarcode支持以下条码象征学:代码128(自动、A、B和C),39码,39码扩展(ASCII),93年代码,代码93扩展(ASCII),标准2的5、交叉2的5、EAN-8,EAN-13,UPC-A,UPC-E(EAN和UPC 2/5数字补充剂),ITF-14,GS1 / UCC / EAN - 128,Codabar,代码11,MSI / Plessey PostNet,MS4SCC,KIX-Code Telepen,跟踪Pharmacode和两个跟踪Pharmacode。现在支持二维码FoxBarcodeQR补充。
FoxBarcode 支持以下图片类型: JPG, BMP, GIF, PNG and TIFF
FoxBarcode使用gpImage2(http://sites.google.com/site/gpimage2)类生成图像,它的作者是Alexander Golovlev(俄罗斯)和塞萨尔 (巴西),基于GDI +和需要gdiplus.dll。
FoxBarcode兼容所有版本6.0版本的VFox。
属性
FoxBarcode允许更好地控制条形码的生成图像能够定制以下属性:
nImageHeight: Height in pixels of the image.
nImageWidth: Width in pixels of the image. Now can set the property
nAlignBarcode: Allows to align the barcode on the left, center or right of the image.
nResolution: Image resolution in DPI.
nRotation: Rotate the image. (0 = 0°, 1 = 90°, 2 = 180°, 3 = 270°)
cImageType: Type of the generated image ("JPG", "GIF" "PNG", "BMP", "TIF")
cImageFile: Name the image file generated. If not specified, it generates a random file name in the folder Windows temporary files.
cText: Text encoding.
nAlignText: Alignment of human-readable text. (0 = Left, 1 = center, 2 = Right)
lShowHumanReadableText: .T. whether to display the human-readable.
lShowCheckDigit: .T. whether to display the check digit on the human-readable.
lShowStartStopChars: .T. if it shows the start and end characters in human-readable.
cFontName: Name of the source of human-readable.
lFontBold: .T. if the source of human-readable is Bold.
lFontItalic: .T. if the source of human-readable is Italic.
nFontSize: Font size of the human-readable. (Recommended = 8 or 9)
nFontColor: Color of the human-readable source. (Recommended = Black = RGB (0,0,0)).
nBackColor: The background color of the image (Recommended = White = RGB (255,255,255)).
nBarsColor: Color of the bars (Recommended = Black = RGB (0,0,0)).
nBarcodeType: Type bar code symbology. See the list of supported barcodes and ID
cSet128: Set of Code 128. ("A", "B", "C" and AUTO with "*" chararacter)
cSupplementalText: Supplementary Text EAN and UPC codes.
lAddCheckDigit: .T. if you calculate the check digit. In symbols, where the check digit is mandatory, not taking into account this property.
nBearerBar: supporting frame type, only in the ITF-14 symbology. (0 = None, 1 = Rectangle, 2 = Top & Bottom)
lUseAppId: .T. FoxBarcode interpreter to code to GS1/UCC/EAN-128 Application Identifiers (enclosed in parentheses)
nFactor: Magnification factor of the bar code. (1 .. 9)
nMargin: Margin around the barcode
nRatio: Relationship between the narrow bars and wide bars in the symbols that allow it.
lDeleteTempFiles: Lets choose if delete or not the temporary folder and image files.
方法
生成的图像,只有一个方法应该调用生成条形码图像并返回生成的路径和文件名:
BarcodeImage(cTextToEncode, cFileNameImage, cPropertyList): 编码文本并返回文件路径生成的条码图像。
所有参数都是可选的。
cTextToEncode: 文本编码。
cFileNameImage: 图像文件生成的名字。如果没有指定,它生成一个随机文件名在Windows临时文件的文件夹。
cPropertyList: 第三个参数设置的所有属性在一行,由逗号分隔。
现在使用BarcodeTest()方法可以验证文本编码不需要生成条形码的图片:
BarcodeTest(cTextToEncode, cFileNameImage, cPropertyList): 验证字符串编码不生成图像。
所有参数都是可选的像BarcodeImage()方法一样。
cTextToEncode: 文本编码。
cFileNameImage: 作为一个图像不是生成的,该参数是一个空字符串。
cPropertyList: 第三个参数设置的所有属性在一行,由逗号分隔。
语言
帮助社区的VFP FoxBarcode消息翻译下列语言:
· ENGLISH
· SPANISH by VFPEncoding
· CZECH by Martin Krivka
· DUTCH by Koen Piller
· GERMAN by Stefan Wuebbe
· INDONESIAN by Samir H.
· PORTUGUESE by Cesar Ch.
· TURKISH by Ugur Yilmaz
· FILIPINO by Glenn Gevero
· FRENCH by Samir H.
· SERBIAN by Michael Kopljan
· ITALIAN by Roberto Saccomanno
你只需要定义编译器指令FBC_LANGUAGE FoxBarcode.prg与所需的语言文件。
#DEFINE FBC_LANGUAGE "ENGLISH"
您可以添加更多的语言在母语翻译消息和发送电子邮件:vfpencoding@gmail.com
例子
下面是一个示例的代码来生成一个图像类型PNG条码代码128 C 100像素的高度和放大倍数2
*-- Create object
loFbc = CREATEOBJECT("FoxBarcode")
*-- Set the properties
WITH loFbc
.cImageType = "PNG"
.nBarcodeType = 110 & & Code 128
.cSet128 = "C" & & Set 128 C
.nImageHeight = 100
.nFactor = 2
ENDWITH
*-- Generate image
lcImagen = loFbc.BarcodeImage("123456789012")
新第三个参数到BarcodeImage()方法,它允许您配置的各种属性,由逗号分隔。上面的例子一样,这种新方法。
*-- Create object
loFbc = CREATEOBJECT("FoxBarcode")
*-- Generate image with the properties
lcImagen = loFbc.BarcodeImage("","",[cText="123456789012", cImageType="PNG", nBarcodeType=110, cSet128="C", nImageHeight=100, nFactor=2])
下面是些用FoxBarcode生成的一些图片。
现在FoxBarcode支持代码EAN / UCC / GS1 128
下面是一个示例测试如果一个字符串是有效的编码EAN-8:
*--- Create FoxBarcode Object
LOCAL loFbc
loFbc = CREATEOBJECT("FoxBarcode")
*-- Generate a test (Ej: EAN-8 -> nBarcodeType = 150)
IF loFbc.BarcodeTest("123456", "", [nBarcodeType = 150])
MESSAGEBOX(["] + loFbc.cText + ["] + " Ok", 64, "Example BarcodeTest()")
ELSE
MESSAGEBOX(loFbc.cMsgError, 16, "Example BarcodeTest()")
ENDIF
包括表单上的条形码,你必须插入一个图片对象。随着条形码图像不存在在设计时,图像的图像属性的名称时,调用BarcodeImage()方法,例如刷新方法的形式,如下图所示:
包括报告上的条形码,你必须插入一个图像对象并设置属性的调用ControlSource BarcodeImage()方法和建议”内容,保留形状“如果图像大小不同于框架。
重要:在你运行报告和创建对象FoxBarcode,必须的变量声明为私有,在报告范围,如下:
PRIVATE poFbc
poFbc = CREATEOBJECT("FoxBarcode)
...
REPORT FORM MyReport
分布
唯一的文件需要分发给FoxBarcode正常工作:
FoxBarcode.prg
gpImage2.prg
这些文件位于源文件夹包含在下载文件中。
在实例化类FoxBarcode之前,您必须运行下面的语句:
SET PROCEDURE TO LOCFILE("FoxBarcode.prg"), LOCFILE("gpImage2.prg") ADDITIVE
Demo Form
FoxBarcode下载的示例表单,我们可以生成条形码的需求,和一个构建器的代码,我们可以将生成的代码复制到剪贴板粘贴到您的应用程序做好准备。
顶部的所有属性的形成有三个选项卡配置类FoxBarcode。
条形码标签”属性“你输入的文本编码,这种象征意义,如果FoxBarcodecalculates校验位。图像的尺寸的条形码来配置:放大倍数,在保证金条形码,形象的高度,狭窄的比例和宽栏(符号允许这种变化)。条形码的旋转也从这个选项卡设置,以及一些特殊属性的符号。
通过符号的列表,当我们去选择的符号的简要描述,有效的人物和他们的更加普遍。
选项卡上的“Human-readable properties”,是否将显示,是否显示校验位,如果它显示字符的开始和结束的符号。理由的字体,大小和颜色设置选项卡。
选项卡"Image and colors"向我们展示了完整的图像文件的名称,这个属性可以作为参数传递或FoxBarcode类生成一个随机的文件名称。这里我们设置图像类型、分辨率(DPI),背景颜色和颜色的酒吧。
一旦你设置的属性,您可以点击按钮“脚本生成器”和FoxBarcode自动生成必要的代码剪切并粘贴在您的应用程序。
附上:FoxBarcode的源码链接:http://download.csdn.net/detail/hyz301/7596781
相关推荐
绿色一维码生成软件 条形码生成器安装的 2个软件 你可以根据喜好选择
java生成一维码,包中的工程直接导入ECLIPSE中,运行web工程
条形码一维码生成代码,只要传入生成的数据就可以生产条形码,适用于移动端和pc端。
条形码生成器,输入数字即可生成,生成后可保存图片,也可直接打印
一维条形码生成并且保存成bmp图片,以方便打印C++MFC源码.输入数字即可转化成bmp一维码图像,且可在图像上打字.方便做出入库系统用
可生成 CODE39,CODE93,CODE128A,CODE128B,CODE128C,CODE2of5,CODEEAN13编码格式的一维码
一维码生成BarcodeLib.dll 和 zxing.dll生成条形码和二维码 ,条码应用,与大家分享。BarcodeLib.dll 一维条码库支持以下条码格式。 ZXing (ZebraCrossing)是一个开源的,支持多种格式的条形码图像处理库, 。使用该...
C#源码开发,提供一维码生成,并可以保存图片。C#源码开发,提供一维码生成,并可以保存图片。C#源码开发,提供一维码生成,并可以保存图片。
该功能为本人自己开发,采用html编写打印模板,生成一维码并打印到A4纸,其中一维码不支持中文,在项目跑起来之后,输入英文与数字
一维码生成与打印程序源代码,powerbuilder 9 控件为active控件,可复用
生成一维码字体,支持cs/bs,适用于条码,唯一编码打印,调用方便;font-size:16px;padding-left: 10px;'>*123456789* 。
pb9.0源码 该代码实测可用,使用一维码请使用手工注册,很简单,有说明。二维码也很简单实现。
支持delphi6版本,不用插件代码实现一维条形码生成功能,支持各种格式code39,code128等几乎所有格式的一维码,条形码生成后打印功能都有,非常齐全
提供一维码的生成,可以嵌入 vb6 ,vs.net 中。可以很快开发出漂亮的一维条码图片,使用于任何的条码打印机。
java的生成一维码的工具类 希望可以提供给又需要的同仁
生成一维码二维码并调用打印机打印
一维码二维码生成识别所需jar包,直接引用即可,
C# 生成和读取读取一维码二维码。输入条码数字内容,然后便可以生成一维条形码和二维条形码,并可以保存为图片。
google zxing读取、生成一维码、二维码图片 google zxing java 一维码 条形码 二维码 生成 读取
生成条形码可调用dll源代码,编码有barcode39、barcode128等等,可以凑合着学习使用,