亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? barcode.pas

?? 條碼打印
?? PAS
字號:
unit BarCode; //39條碼 EAN13條碼 函數集

interface

uses Windows, SysUtils, Graphics;

const
  BcCode39: array[0..42] of string =
  ('101001101101', '110100101011', '101100101011', '110110010101', '101001101011',
    '110100110101', '101100110101', '101001011011', '110100101101', '101100101101',
    '110101001011', '101101001011', '110110100101', '101011001011', '110101100101',
    '101101100101', '101010011011', '110101001101', '101101001101', '101011001101',
    '110101010011', '101101010011', '110110101001', '101011010011', '110101101001',
    '101101101001', '101010110011', '110101011001', '101101011001', '101011011001',
    '110010101011', '100110101011', '110011010101', '100101101011', '110010110101',
    '100110110101', '100101011011', '110010101101', '100100100101', '100100101001',
    '100101001001', '101001001001', '100101101101');

  BcChar39: array[0..42] of char =
  ('0', '1', '2', '3', '4',
    '5', '6', '7', '8', '9',
    'A', 'B', 'C', 'D', 'E',	
    'F', 'G', 'H', 'I', 'J',
    'K', 'L', 'M', 'N', 'O',
    'P', 'Q', 'R', 'S', 'T',
    'U', 'V', 'W', 'X', 'Y',
    'Z', '-', '.', '$', '/',
    '+', '%', '*');
    
  BcCodeEan: array[0..29] of string =
  ('1110010', '1100110', '1101100', '1000010', '1011100',
    '1001110', '1010000', '1000100', '1001000', '1110100',
    '0001101', '0011001', '0010011', '0111101', '0100011',
    '0110001', '0101111', '0111011', '0110111', '0001011',
    '0100111', '0110011', '0011011', '0100001', '0011101',
    '0111001', '0000101', '0010001', '0001001', '0010111');

  BcECEan: array[1..9] of string =
  ('111111000000', '112122000000', '112212000000', '121122000000', '122112000000',
    '122211000000', '121212000000', '121221000000', '122121000000');

//EAN13效驗位計算
function GetEanVerify(InputS: string): string;
//EAN13條碼輸出
//aC 畫板  R 區域  BrStep 步長 BrColor1 前景顏色 BrColor2 背景顏色
function PutImgBrEan(InPtS: string; aC: TCanvas; R: TRect; BrStep: Word; BrColor1: TColor = clBlack; BrColor2: TColor = clWhite): string;

//39 條碼識別  ScanC 0 - 輸出黑白10序列 1 - 按步長解析成10序列 2 -解析成字符串
function ScanImgBr39(aC: TCanvas; R: TRect; ScanC: byte = 2): string;
//39 條碼輸出
procedure PutImgBr39(InPtS: string; aC: TCanvas; R: TRect; BrStep: Word ; BrColor1:TColor=clBlack;BrColor2:TColor=clWhite);

implementation


{*****************}
{     EAN 條碼    }
{*****************}

function PutImgBrEan(InPtS: string; aC: TCanvas; R: TRect; BrStep: Word; BrColor1: TColor = clBlack; BrColor2: TColor = clWhite): string;
var
  bmXlStr: string;
  Inx, Iny: Word;
  OutPtStr: string;
  BrX, BrY, BrHigh: Word;
  //字符轉打印序列
  function BrCharToStr(I: Byte): string;
  begin
    result := '';
    if I >= 2 then
      case StrToInt(BmXlStr[I - 1]) of
        0: result := BcCodeEan[0 + StrToInt(InPtS[I])];
        1: result := BcCodeEan[10 + StrToInt(InPtS[I])];
        2: result := BcCodeEan[20 + StrToInt(InPtS[I])];
      end;
    case I of
      1: result := '101';
      7: result := result + '01010';
      13: result := result + '101';
    end;
  end;
begin
  BmXlStr := BcECEan[StrToInt(InPtS[1])];
  if Length(InPts)>=12 then
    InPts:=Copy(InPts,1,12);
  InPtS := GetEanVerify(InPtS);
  OutPtStr := '';
  result := '';
  for Inx := 1 to Length(InPtS) do
  begin
    OutPtStr := OutPtStr + BrCharToStr(Inx);
    result :=result + IntToStr(Inx)+':'+BrCharToStr(Inx)+'>' ;
  end;
  aC.Pen.Color := BrColor2;
  aC.Rectangle(R);
  BrX := R.Left;
  BrY := R.Top;
  BrHigh := R.Bottom - R.Top + 1;
  //設置條碼字體
  With aC.Font do
  begin
    Name := 'OCR-B 10 BT';
    Style := [fsBold];
    Size := BrStep*6 ;
  end; 
  //輸出條碼字體
  aC.TextOut(BrStep*3,BrY + BrHigh-BrStep * 9,InPtS[1]);
  for Inx:=2 to Length(InPtS) do
    if Inx<=7 then
      aC.TextOut(Round(BrStep*14) +BrStep*7*(Inx-2),BrY + BrHigh-BrStep * 9,InPtS[Inx])
    else
      aC.TextOut(Round(BrStep*14)+5*BrStep+BrStep*7*(Inx-2),BrY + BrHigh-BrStep * 9,InPtS[Inx]) ;
  //輸出打印序列
  for Inx := 1 to Length(OutPtStr) do
    for Iny := 1 to BrStep do
    begin
      if OutPtStr[Inx] = '1' then
        aC.Pen.Color := BrColor1
      else
        aC.Pen.Color := BrColor2;
      aC.MoveTo(Brx + BrStep*10 + (Inx - 1) * BrStep + Iny - 1, BrY+BrStep * 5);
      if Inx In [1..3,46..50,93..95] then
        aC.LineTo(Brx + BrStep*10  + (Inx - 1) * BrStep + Iny - 1, BrY + BrHigh-BrStep * 5 )
      else
        aC.LineTo(Brx + BrStep*10  + (Inx - 1) * BrStep + Iny - 1, BrY + BrHigh-BrStep * 9);
    end;
end;

//由7位或12位碼產生相應校驗位,從而生成標準8位或13位碼

function GetEanVerify(InputS: string): string;
var
  inx, sum: Integer;
begin
  sum := 0;
  for inx := 1 to length(InputS) do
  begin
    if (inx mod 2) = 1 then
      sum := sum + (StrToInt(InputS[inx]) * 1)
    else
      sum := sum + (StrToInt(InputS[inx]) * 3);
  end;
  result := InputS + IntToStr(10 - (sum mod 10));
end;

{*****************}
{     39 條碼     }
{*****************}

procedure PutImgBr39(InPtS: string; aC: TCanvas; R: TRect; BrStep: Word ; BrColor1:TColor=clBlack;BrColor2:TColor=clWhite);
var
  Inx, Iny: Word;
  OutPtStr: string;
  BrX, BrY, BrHigh: Word;
  function BrCharToStr(S: string): string;
  var
    XInx: Integer;
  begin
    result := '';
    for XInx := 0 to 42 do
      if S = BcChar39[XInx] then
      begin
        result := BcCode39[XInx];
        Break;
      end;
  end;
  function BrStrToStr(S: string): string;
  var
    XInx: Integer;
  begin
    result := '';
    for XInx := 1 to Length(S) do
      result := result + BrCharToStr(S[XInx]) + '0';
  end;
begin
  aC.Pen.Color:=  BrColor2;
  aC.Rectangle(R);
  //BrColor2
  OutPtStr := BrStrToStr(UpperCase(InPtS));
  BrX := R.Left;
  BrY := R.Top;
  BrHigh := R.Bottom - R.Top + 1;
  for Inx := 1 to Length(OutPtStr) do
    for Iny := 1 to BrStep do
    begin
      if OutPtStr[Inx] = '1' then
        aC.Pen.Color := BrColor1
      else
        aC.Pen.Color := BrColor2;
      aC.MoveTo(Brx + (Inx - 1) * BrStep + Iny - 1, BrY);
      aC.LineTo(Brx + (Inx - 1) * BrStep + Iny - 1, BrY + BrHigh)
    end;
end;

function ScanImgBr39(aC: TCanvas; R: TRect; ScanC: byte = 2): string;
var
  ScanInx: byte;
  StepLen,ScanStepHigh: Word;
  ScanResult: array[0..2] of string;
  function GetLuma(Color: TColor): Byte;
  var
    r, g, b: Byte;
  begin
    r := Color and $FF;
    g := Color shr 8 and $FF;
    b := Color shr 16 and $FF;
    Result := Round(r * 0.3 + g * 0.59 + b * 0.11)
  end;
  function ScanStrToChar(S: string): string;
  var
    XInx: Integer;
  begin
    result := '';
    for XInx := 0 to 42 do
      if S = BcCode39[XInx] then
      begin
        result := BcChar39[XInx];
        Break;
      end;
  end;
  function EncodeBr(s: string): string;
  var
    XInx, YInx, Charlen: word;
    TestStepStr: string;
    OldChar: Char;
    UnitChar, EncodeChar: string;
  begin
    result := '';
    if Length(S) < 5 then Exit;
    StepLen := StepLen;
    for XInx := Round(StepLen / 5) downto 1 do
    begin
      TestStepStr := '';
      for Yinx := 1 to XInx do
        TestStepStr := TestStepStr + '1';
      if Pos('0' + TestStepStr + '0', S) > 0 then
        StepLen := XInx;
    end;
    OldChar := '1';
    Charlen := 0;
    UnitChar := '';
    EncodeChar := '';
    if S[Length(S)] = '1' then
      S := S + '0'
    else
      S := S + '1';
    for XInx := 1 to Length(S) do
    begin
      if S[XInx] <> OldChar then
      begin
        OldChar := S[XInx];
        Charlen := Length(UnitChar);
        if OldChar = '1' then
          case (CharLen * 10 div StepLen) of
            5..14: EncodeChar := EncodeChar + '0';
            15..35: EncodeChar := EncodeChar + '00'
          end;
        if OldChar = '0' then
          case (CharLen * 10 div StepLen) of
            5..19: EncodeChar := EncodeChar + '1';
            20..35: EncodeChar := EncodeChar + '11'
          end;
        UnitChar := OldChar;
      end
      else
        UnitChar := UnitChar + OldChar;
    end;
    YInx := 0;
    UnitChar := '';
    EncodeChar := EncodeChar + '1';
    //result := S+'   >>   '+EncodeChar ;
    case ScanC of
      1: begin
           result := EncodeChar ;
         end;
      2:
        begin
          for XInx := 1 to Length(EncodeChar) do
          begin
            Inc(YInx);
            if YInx <= 12 then
              UnitChar := UnitChar + EncodeChar[XInx]
            else
              if EncodeChar[XInx] = '1' then
              begin
                YInx := 1;
                result := result + ScanStrToChar(UnitChar);
                UnitChar := '1';
              end;
          end;
        end;
    end;
  end;
  function ScanImgBrXul(Y: word): string;
  var
    ColorAvg, ColorMax, ColorMin: Integer;
    XInx: Integer;
    BcBegin: Boolean;
    S: string;
  begin
    BcBegin := False;
    result := '';
    ColorAvg := 0;
    ColorMax := 0;
    ColorMin := 255;
    for XInx := R.Left to R.Right do
    begin
      ColorAvg := GetLuma(aC.Pixels[XInx, Y]);
      if ColorAvg < ColorMin then ColorMin := ColorAvg;
      if ColorAvg > ColorMax then ColorMax := ColorAvg;
    end;
    ColorAvg := Round(ColorMin + 0.6 * (ColorMax - ColorMin));
    if ColorAvg >= 255 then ColorAvg := 200;
    for XInx := R.Left to R.Right do
    begin
      if not (BcBegin) and (GetLuma(aC.Pixels[XInx, Y]) < ColorAvg) then BcBegin := True;
      if BcBegin then result := result + IntToStr(1 - (GetLuma(aC.Pixels[XInx, Y]) div ColorAvg));
      //if (GetLuma(aC.Pixels[XInx, Y]) < ColorAvg) then
      //  aC.Pixels[XInx, Y] := ClRed
      //else
      //  aC.Pixels[XInx, Y] := clYellow;
    end;
    for XInx := Length(result) downto 1 do
      if result[XInx] = '0' then
        result := Copy(result, 1, XInx - 1)
      else
        Break;
  end;
begin
  result := '';
  ScanInx := 0;
  ScanStepHigh:= ( R.Bottom - R.Top + 1 ) div 3 ;
  case ScanC of
    0: begin
        for ScanInx := 0 to 2 do
          ScanResult[ScanInx] := ScanImgBrXul(((R.Top + R.Bottom) div 2) + (-ScanStepHigh + ScanStepHigh * (ScanInx mod 3)));
        result := '1: '+ScanResult[0] + ' 2: ' + ScanResult[1] + ' 3: ' + ScanResult[2]+' END';
      end;
    1..2:
      begin
        for ScanInx := 0 to 2 do
          ScanResult[ScanInx] := ScanImgBrXul(((R.Top + R.Bottom) div 2) + (-ScanStepHigh + ScanStepHigh * (ScanInx mod 3)));
        if ScanResult[0] = ScanResult[1] then
          result := EncodeBr(ScanResult[0])
        else
          if ScanResult[1] = ScanResult[2] then
            result := EncodeBr(ScanResult[1])
          else
            if ScanResult[2] = ScanResult[0] then
              result := EncodeBr(ScanResult[2]);
      end;
  end;
end;
end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲视频一区二区在线| 在线观看一区不卡| 亚洲444eee在线观看| 成人精品小蝌蚪| 五月天欧美精品| 成人av电影在线网| 亚洲自拍偷拍网站| 国产成人av网站| 一本到三区不卡视频| 久久狠狠亚洲综合| 日韩一区在线播放| 91国偷自产一区二区三区观看| 亚洲国产成人91porn| 亚洲一区二区精品久久av| 欧美成人伊人久久综合网| 中文字幕一区二区三中文字幕| 麻豆久久久久久久| 国产综合色视频| 欧美日韩精品一区二区在线播放| 91网上在线视频| 欧美一级夜夜爽| 成人蜜臀av电影| 精品国产髙清在线看国产毛片| 一个色综合av| 4438x成人网最大色成网站| 在线观看日韩电影| 东方aⅴ免费观看久久av| 色综合亚洲欧洲| 日本va欧美va精品发布| 91精品婷婷国产综合久久性色| 亚洲黄色免费电影| 国产成人久久精品77777最新版本| 91超碰这里只有精品国产| 蜜臀国产一区二区三区在线播放| 91麻豆国产自产在线观看| 一区二区视频在线看| 蜜臀a∨国产成人精品| 国产99精品视频| 亚洲电影视频在线| 国产很黄免费观看久久| 欧美亚洲高清一区| 国产精品私人自拍| 日韩精品91亚洲二区在线观看| 91首页免费视频| 久久久精品tv| 欧美mv日韩mv国产网站| 欧美三级在线播放| 中文字幕色av一区二区三区| 白白色 亚洲乱淫| 一区二区三区成人在线视频| 在线综合亚洲欧美在线视频| 韩国女主播一区二区三区| 国产日韩欧美激情| 欧美性猛片xxxx免费看久爱| 日韩电影免费一区| 国产视频视频一区| 91国产精品成人| 秋霞午夜av一区二区三区| 久久精品日产第一区二区三区高清版 | 亚洲777理论| 欧美大片国产精品| 色综合视频一区二区三区高清| 亚洲成人1区2区| 久久婷婷色综合| 欧洲一区在线观看| 麻豆精品新av中文字幕| 中文字幕一区二区三区不卡| 在线成人免费观看| 国产成人在线视频网站| 一级日本不卡的影视| 久久只精品国产| 欧美在线制服丝袜| 国产成人午夜高潮毛片| 亚洲动漫第一页| 久久久久久久综合色一本| 欧亚洲嫩模精品一区三区| 国产福利不卡视频| 奇米精品一区二区三区四区| 亚洲男人的天堂av| 国产欧美一区二区三区网站 | 色婷婷精品大在线视频| 国产一区二三区| 亚洲午夜精品在线| 中文字幕视频一区| 国产婷婷精品av在线| 欧美一区二区三区四区在线观看| 99re这里都是精品| 粉嫩13p一区二区三区| 人禽交欧美网站| 亚洲国产wwwccc36天堂| 国产精品高潮久久久久无| 久久久亚洲精品一区二区三区| 欧美日韩国产综合一区二区三区 | 成人动漫中文字幕| 精品在线你懂的| 日日嗨av一区二区三区四区| 亚洲自拍另类综合| 亚洲日本va午夜在线电影| 久久久久99精品国产片| 日韩欧美国产三级电影视频| 91精品综合久久久久久| 欧美人xxxx| 在线观看国产91| 一本大道av一区二区在线播放| jizz一区二区| 成人免费视频视频| 国产成人精品亚洲日本在线桃色| 久久国产精品一区二区| 极品尤物av久久免费看| 蜜臀av一区二区在线观看| 亚洲一级电影视频| 亚洲最色的网站| 一区二区三区精品视频| 亚洲免费观看高清完整版在线| 中文字幕亚洲视频| 亚洲精品中文字幕乱码三区| 18欧美乱大交hd1984| 亚洲免费观看高清完整版在线观看熊 | 蜜臀av性久久久久av蜜臀妖精| 偷拍与自拍一区| 日本成人在线一区| 久久精品国产99国产精品| 精品午夜久久福利影院| 国产一区不卡精品| 成人免费高清视频在线观看| 91免费看`日韩一区二区| 色8久久精品久久久久久蜜| 欧美性做爰猛烈叫床潮| 欧美色爱综合网| 欧美一区二区观看视频| 久久婷婷色综合| 综合久久久久久| 亚洲成av人片在www色猫咪| 日产国产高清一区二区三区 | 男女男精品网站| 欧美在线啊v一区| 亚洲一区二区三区四区在线| 亚洲一区二区三区四区五区中文| 天堂在线亚洲视频| 国产真实乱偷精品视频免| proumb性欧美在线观看| 欧美日韩在线播放| 欧美成va人片在线观看| 国产精品福利一区二区| 香蕉久久夜色精品国产使用方法| 精品一二线国产| 成人av在线电影| 欧美日本高清视频在线观看| 国产日韩欧美精品综合| 一区二区日韩av| 国产尤物一区二区| 欧美午夜精品久久久久久超碰 | 国产精品麻豆视频| 亚洲成a人片综合在线| 国产一区二区三区在线看麻豆| 91美女片黄在线观看91美女| 欧美一激情一区二区三区| **欧美大码日韩| 另类的小说在线视频另类成人小视频在线 | 色欧美片视频在线观看在线视频| 欧美一级二级在线观看| 一区二区三区日韩欧美精品| 激情五月激情综合网| 欧美综合亚洲图片综合区| 2020国产精品| 日韩国产精品久久久| 色婷婷精品大在线视频| 国产蜜臀av在线一区二区三区| 日韩av一区二| 在线亚洲免费视频| 欧美国产禁国产网站cc| 久久99精品国产.久久久久久| 在线观看欧美精品| 中文字幕日韩精品一区 | 国产在线精品不卡| 欧美视频精品在线| 国产精品美女www爽爽爽| 黄页视频在线91| 日韩一级二级三级精品视频| 亚洲影视资源网| 色综合天天综合网天天狠天天| 欧美激情一二三区| 国产一区高清在线| 欧美电视剧免费全集观看| 日日夜夜一区二区| 欧美日韩一二三| 亚洲大片在线观看| 欧美中文一区二区三区| 亚洲男同1069视频| 色网站国产精品| 亚洲精品国产无天堂网2021| 一本一道久久a久久精品综合蜜臀| 中文字幕巨乱亚洲| 成人综合婷婷国产精品久久蜜臀| 精品对白一区国产伦| 国模无码大尺度一区二区三区| 欧美va天堂va视频va在线| 狠狠色丁香久久婷婷综| 国产亚洲一本大道中文在线| 国产精品一二三在|