Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
how to pass qrcode from .netcore api to angular

From my back end im getting an object which is shown in the screenshot below

image

In the angular side how can i convert it to image which is a qrcode,because i don't see any bytes there to convert it,is this object valid to be shown as a qrcode?

on my back end i send data from .netcore which is :

  public async  Task<IActionResult> ExecuteAsync(TreydModel treydmodel, CancellationToken cancellationToken)
    {
        string txtQRCode = "morteza";
       var sendPayinResponse=await  sendpaying.SendPayinInitiateRequest(treydmodel);
        QRCodeGenerator _qrCode = new QRCodeGenerator();
        QRCodeData _qrCodeData = _qrCode.CreateQrCode(txtQRCode, QRCodeGenerator.ECCLevel.Q);
        QRCode qrCode = new QRCode(_qrCodeData);
        Bitmap qrCodeImage = qrCode.GetGraphic(20);
        BitmapToBytesCode(qrCodeImage);
        return new OkObjectResult(qrCodeImage);

    }
    private static Byte[] BitmapToBytesCode(Bitmap image)
    {
        using (MemoryStream stream = new MemoryStream())
        {
            image.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
            return stream.ToArray();
        }
    }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I'm not sure if it is what you are looking for. Pls see my code and test result below.

<div id="code"></div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
<script>
    var test = {
        "flags": 2,
        "frameDimensionsList": [
            "123456789456"
        ],
        "height": 580,
        "horizontatlResolution": 96,
        "palette": {
            "flag": 0,
            "entries":[]
        }
    };
    $('#code').qrcode(JSON.stringify(test)); 
</script>

enter image description here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!