devya Posted May 19, 2020 Posted May 19, 2020 Dear all, can guide me how do i generate the qrcode with unigui ? is there any direct VCL to generate QRCode ? Thanks Quote
x11 Posted May 19, 2020 Posted May 19, 2020 http://forums.unigui.com/index.php?/topic/12087-unigui-does-qrcode/ http://forums.unigui.com/index.php?/topic/2457-qrcode-decode-encode/ http://forums.unigui.com/index.php?/topic/12995-barcode-qrcode-android-and-ios-for-unigui-touch/ http://forums.unigui.com/index.php?/topic/13396-scan-1d2d-code-from-video-camera/ http://forums.unigui.com/index.php?/topic/12994-barcode-qrcode-android-and-ios-for-unigui-touch/ 1 Quote
Mehmet Emin Posted May 19, 2020 Posted May 19, 2020 Here is my unigui qr code generator You will need DelphiZXingQRCode though procedure TUniMainModule.CreateTicketQRCode(const ATicketId, ATicketUrl: string); procedure ResizeBitmap(Bitmap: TBitmap; const NewWidth, NewHeight: integer); var buffer: TBitmap; begin buffer := TBitmap.Create; try buffer.SetSize(NewWidth, NewHeight); buffer.Canvas.StretchDraw(Rect(0, 0, NewWidth, NewHeight), Bitmap); Bitmap.SetSize(NewWidth, NewHeight); Bitmap.Canvas.Draw(0, 0, buffer); finally buffer.Free; end; end; var QRCodeBitmap: TBitmap; QRCode: TDelphiZXingQRCode; Row, Column: Integer; PNG: TPNGImage; begin if UniServerModule.ConfigINI.QRCodeSaveDir = '' then Exit; QRCodeBitmap := nil; QRCode := nil; PNG := nil; try QRCodeBitmap := TBitmap.Create; QRCode := TDelphiZXingQRCode.Create; QRCode.Data := ATicketUrl; QRCodeBitmap.SetSize(QRCode.Rows, QRCode.Columns); for Row := 0 to QRCode.Rows - 1 do begin for Column := 0 to QRCode.Columns - 1 do begin if (QRCode.IsBlack[Row, Column]) then begin QRCodeBitmap.Canvas.Pixels[Column, Row] := clBlack; end else begin QRCodeBitmap.Canvas.Pixels[Column, Row] := clWhite; end; end; end; ResizeBitmap(QRCodeBitmap, QRCode.Rows*5, QRCode.Columns*5); PNG := TPNGImage.Create; PNG.Assign(QRCodeBitmap); PNG.SaveToFile(TPath.Combine(UniServerModule.ConfigINI.QRCodeSaveDir, LowerCase(ATicketId)+'.png')); finally QRCodeBitmap.Free; QRCode.Free; PNG.Free; end; end; Quote
Marlon Nardi Posted September 19, 2023 Posted September 19, 2023 Component Free with Full Source: https://store.falconsistemas.com.br 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.