資源簡介
C++ 條碼,二維碼生成程序(Qt 界面),整合 BarCode,QREncode 兩個開源庫, 當然也有掃描識別部分沒加進來 ,掃描識別使用 zxing opensource project, 已經測試過,有 android(java) 和 C++ 版本,有時間再整理上傳。
代碼片段和文件信息
/*
?*?codabar.c?--?encoding?for?Codabar
?*
?*?Copyright?(c)?2000?Leonid?A.?Broukhis?(leob@mailcom.com)
?*?Copyright?(c)?2010?2011?Giuseppe?Scrivano?(gscrivano@gnu.org)
?*
?*???This?program?is?free?software;?you?can?redistribute?it?and/or?modify
?*???it?under?the?terms?of?the?GNU?General?Public?License?as?published?by
?*???the?Free?Software?Foundation;?either?version?3?of?the?License?or
?*???(at?your?option)?any?later?version.
?*
?*???This?program?is?distributed?in?the?hope?that?it?will?be?useful
?*???but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
?*???MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
?*???GNU?General?Public?License?for?more?details.
?*
?*??You?should?have?received?a?copy?of?the?GNU?General?Public?License
?*??along?with?this?program.??If?not?see? .
?*/
#include?“barcode.h“
#include?
#include?
#include?
#include?
#include?
/*?this?is?ordered?in?decades?to?simplify?encoding?*/
static?char?alphabet[]?=?
???“0123456789“?“-$:/.+ABCD“;
#define?CODE_A 16
#define?CODE_B 17
#define?NARROW 12
#define?WIDE 14
/*?Patterns?*/
static?char?*patterns[]?=?{
“1111133““1111331““1113113““3311111““1131131“
“3111131““1311113““1311311““1331111““3113111“
“1113311““1133111““3111313““3131113““3131311“
“1131313““1133131““1313113““1113133““1113331“?};
/*
?*?Check?that?the?text?can?be?encoded.?Returns?0?or?-1.
?*?If?it‘s?all?lowecase?convert?to?uppercase?and?accept?it.
?*?If?the?first?character?is?a?letter?(A?to?D)?the?last?one?must?be?too;
?*?no?other?character?should?be?a?letter.
?*/
int?Barcode_cbr_verify(char?*text)
{
????int?i?lower=0?upper=0;
????int?startpresent?=?0;
????if?(!strlen(text))
return?-1;
????for?(i=0;?text[i];?i++)?{
char?*?pos;
????????if?(isupper(text[i]))?upper++;
????????if?(islower(text[i]))?lower++;
pos?=?strchr(alphabettoupper(text[i]));
????????if?(!pos)
????????????return?-1;
if?(i?==?0?&&?pos?-?alphabet?>=?CODE_A)
????startpresent?=?1;
else?if?(pos?-?alphabet?>=?CODE_A?&&
?(!startpresent?||?i?!=?strlen(text)?-?1))
????return?-1;?
????}
????if?(lower?&&?upper)
????????return?-1;
????return?0;
}
static?int?add_one(char?*ptr?int?code)
{
????sprintf(ptr“1%s“?/*?separator?*/?patterns[code]);
????return?0;
}
/*
?*?The?encoding?functions?fills?the?“partial“?and?“textinfo“?fields.
?*?Lowercase?chars?are?converted?to?uppercase
?*/
int?Barcode_cbr_encode(struct?Barcode_Item?*bc)
{
????static?char?*text;
????static?char?*partial;??/*?dynamic?*/
????static?char?*textinfo;?/*?dynamic?*/
????char?*c?*ptr?*textptr;
????int?i?code?textpos?usesum?checksum?=?0?startpresent;
????if?(bc->partial)
free(bc->partial);
????if?(bc->textinfo)
free(bc->textinfo);
????bc->partial?=?bc->textinfo?=?NULL;?/*?safe?*/
????if?(!bc->encoding)
bc->encoding?=?strdup(“codabar“);
????text?=?bc->ascii;
????if?(!text)?{
????????bc->error?=?EINVAL;
????????return?-1;
????}
????/*?the?partial?code?is?8?*?(he
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????54784??2016-04-06?11:09??tootzoe_qr_bar_code\Qr_bar_code\BarCode.dll
?????文件??????40246??2016-01-11?20:47??tootzoe_qr_bar_code\Qr_bar_code\icon.jpg
?????文件?????119822??2014-12-22?00:07??tootzoe_qr_bar_code\Qr_bar_code\libgcc_s_dw2-1.dll
?????文件????1026062??2014-12-22?00:07??tootzoe_qr_bar_code\Qr_bar_code\libstdc++-6.dll
?????文件??????49152??2014-12-22?00:07??tootzoe_qr_bar_code\Qr_bar_code\libwinpthread-1.dll
?????文件??????31744??2015-10-13?03:45??tootzoe_qr_bar_code\Qr_bar_code\platforms\qminimal.dll
?????文件?????669696??2015-10-13?03:45??tootzoe_qr_bar_code\Qr_bar_code\platforms\qoffscreen.dll
?????文件????1413632??2015-10-13?03:46??tootzoe_qr_bar_code\Qr_bar_code\platforms\qwindows.dll
?????文件?????246784??2015-10-13?03:45??tootzoe_qr_bar_code\Qr_bar_code\plugins\imageformats\qjpeg.dll
?????文件??????28672??2015-10-13?03:48??tootzoe_qr_bar_code\Qr_bar_code\plugins\imageformats\qsvg.dll
?????文件?????804352??2015-10-13?03:44??tootzoe_qr_bar_code\Qr_bar_code\plugins\sqldrivers\qsqlite.dll
?????文件??????72704??2015-10-13?03:44??tootzoe_qr_bar_code\Qr_bar_code\plugins\sqldrivers\qsqlmysql.dll
?????文件??????50176??2016-04-06?10:23??tootzoe_qr_bar_code\Qr_bar_code\QrEncode.dll
?????文件????5391360??2015-11-28?22:52??tootzoe_qr_bar_code\Qr_bar_code\Qt5Core.dll
?????文件????5334528??2015-10-13?03:31??tootzoe_qr_bar_code\Qr_bar_code\Qt5Gui.dll
?????文件????1528832??2015-10-13?03:26??tootzoe_qr_bar_code\Qr_bar_code\Qt5Network.dll
?????文件?????259072??2015-10-13?03:25??tootzoe_qr_bar_code\Qr_bar_code\Qt5Sql.dll
?????文件?????331776??2015-10-13?03:48??tootzoe_qr_bar_code\Qr_bar_code\Qt5Svg.dll
?????文件????6541824??2015-10-13?03:37??tootzoe_qr_bar_code\Qr_bar_code\Qt5Widgets.dll
?????文件????1413632??2015-10-13?03:46??tootzoe_qr_bar_code\Qr_bar_code\qwindows.dll
?????文件??????38912??2016-04-06?11:10??tootzoe_qr_bar_code\Qr_bar_code\testQRGenerator.exe
?????文件???????4136??2016-04-05?22:32??tootzoe_qr_bar_code\win_src\libBarCode\barcode.h
?????文件???????5014??2013-03-30?06:22??tootzoe_qr_bar_code\win_src\libBarCode\codabar.c
?????文件???????5196??2013-03-30?06:22??tootzoe_qr_bar_code\win_src\libBarCode\code11.c
?????文件??????16986??2013-03-30?06:22??tootzoe_qr_bar_code\win_src\libBarCode\code128.c
?????文件???????6691??2013-03-30?06:22??tootzoe_qr_bar_code\win_src\libBarCode\code39.c
?????文件???????7013??2013-03-30?06:22??tootzoe_qr_bar_code\win_src\libBarCode\code93.c
?????文件??????49044??2016-04-06?10:22??tootzoe_qr_bar_code\win_src\libBarCode\config.h
?????文件??????20293??2013-03-30?06:23??tootzoe_qr_bar_code\win_src\libBarCode\ean.c
?????文件???????4570??2013-03-30?06:23??tootzoe_qr_bar_code\win_src\libBarCode\i25.c
............此處省略144個文件信息
- 上一篇:JAVA微信支付退款接口demo
- 下一篇:android獲取焦點后按鈕變大
評論
共有 條評論