如何採用C 繪製39條形碼

2021-04-19 20:23:11 字數 2661 閱讀 5236

}private string headertext="浙江紹興";

public string headertext

set

}private string barcodetext = "";

public string barcodetext

set

}private bool showheader;

public bool showheader

set

}private bool showfooter;

public bool showfooter

set

}private int headerfontsize;

public int headerfontsize

set

}private int footerfontsize;

public int footerfontsize

set

}private string headerfontfamily;

public string headerfontfamily

set

}private string footerfontfamily;

public string footerfontfamily

set

}protected font headerfont=null;

protected font footerfont=null;

public cjbarcode()

protected virtual void drawbitmap(graphics g, rectangle rects)

protected virtual void drawtext(string text,graphics g, rectangle rects)

}public class cjbarcode39 : cjbarcode

set

}private int  weight = 1;

public int weight

set

}///

/// 39條碼中能使用的字元

///

private string alphabet39 = "0123456789abcdefghijklmnopqrstuvwxyz-. $/+%*";

private string coded39char =

;public cjbarcode39()

///

/// 為了使得條形碼居中先要計算條形碼的left和top座標

///

///

private int getx()

else

//畫第6個     5   白條

if ((j + 5) < 9)

else}}

currentlocation += weight;

}return currentlocation;

}///

/// 顯示條形碼

///

/// gdi+

/// 畫圖區域

protected override void drawbitmap(graphics g, rectangle rects)

else

//畫第6個     5   白條

if ((j + 5) < 9)

else}}

rectangle re2 = new rectangle(currentlocation, ytop, weight, barcodeheight);

g.fillrectangle(witebrush, re2);

currentlocation += weight; }}

///

/// 顯示條形碼和文字

///

///

///

public void drawbarcode(graphics g, rectangle rects)

///

/// 文字顯示

///

///

///

///

protected override void drawtext(string text, graphics g, rectangle rects)}}

c 如何列印條形碼

1 實現部分 定義乙個列印文件物件 printdocument printdocument1 new printdocument 開始列印 public void beginprint string cardcode 初始化列印 public void printinit 列印的頁面 void pr...

C 掃條形碼

需要有呼叫窗體註冊 keydown事件且屬性 keypreview true region 條件處理barcodehook barcodehook null private void mie mainfrom keydown object sender,keyeventargs e void bar...

生成條形碼 條碼申請後如何生成商品條形碼

很多小夥伴只知道商品條形碼需要申請,但是條碼申請後如何生成商品條形碼就不知道如何操作了,今天就給大家詳細介紹一下商品條形碼生成方法。咱們國家商品條形碼的型別是ean 13條碼 69開頭的國別碼,廠商識別 產品 1位校驗位 條碼申請後就會有分配的國別碼和廠商識別 產品 需要自己編輯,校驗位可由條碼生成...