請問Delphi7下的ZIntQRCode控制元件,怎么列印二維碼?謝謝!
uj5u.com熱心網友回復:
生成圖片,然後用圖片模式,不就能列印了嗎uj5u.com熱心網友回復:
https://github.com/chaosben/theunknownones/tree/008e179efedb99dd2ec1e40b83ef2b15ec62e18e/Libraries/Zintuj5u.com熱心網友回復:
顯示在form1上再
Form1.Print;
uj5u.com熱心網友回復:
能否發個dome,[email protected],謝謝!
uj5u.com熱心網友回復:
二維碼其實就是一個黑白矩陣,以此自己畫出一個影像是最靠譜的也不會太難.uj5u.com熱心網友回復:
input_mode :=KANJI_MODE這樣就支持中文了
我不知道你的控制元件是不是DLL版的
如果是的話,那么可以用ZBarcodeToBitmap來轉換;
如果是github的原始碼版的,那么用以下函式轉換成bitmap就行
procedure GraphicToBitmap(const Src: Graphics.TGraphic;
const Dest: Graphics.TBitmap;
const TransparentColor: Graphics.TColor=Graphics.clNone);
begin
// Do nothing if either source or destination are nil
if not Assigned(Src) or not Assigned(Dest) then
Exit;
// Size the bitmap
Dest.Width := Src.Width;
Dest.Height := Src.Height;
if Src.Transparent then
begin
// Source graphic is transparent, make bitmap behave transparently
Dest.Transparent := True;
if (TransparentColor <> Graphics.clNone) then
begin
// Set destination as transparent using required colour key
Dest.TransparentColor := TransparentColor;
Dest.TransparentMode := Graphics.tmFixed;
// Set background colour of bitmap to transparent colour
Dest.Canvas.Brush.Color := TransparentColor;
end
else
// No transparent colour: set transparency to automatic
Dest.TransparentMode := Graphics.tmAuto;
end;
// Clear bitmap to required background colour and draw bitmap
Dest.Canvas.FillRect(Classes.Rect(0, 0, Dest.Width, Dest.Height));
Dest.Canvas.Draw(0, 0, Src);
end;
資料:
Delphi 呼叫Zint 實作二維碼功能
Delphi Graphic轉換成Bitmap
(轉載) Delphi中列印條碼的方法
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/72937.html
標籤:VCL組件開發及應用
上一篇:Unit 'FireDAC.Phys.MSSQL' not found
下一篇:標準運算式中資料型別不匹配!!
