Git Product home page Git Product logo

Comments (6)

iAmBipinPaul avatar iAmBipinPaul commented on August 24, 2024 1

Hi !
I don't see any overload method for GetGraphic() , which will take icon as svg string and it will generate SVG.

namespace QRCoder
{
    public class SvgQRCode : AbstractQRCode, IDisposable
    {
        public SvgQRCode();
        public SvgQRCode(QRCodeData data);

        public string GetGraphic(int pixelsPerModule);
        public string GetGraphic(int pixelsPerModule, Color darkColor, Color lightColor, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute);
        public string GetGraphic(int pixelsPerModule, string darkColorHex, string lightColorHex, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute);
        public string GetGraphic(Size viewBox, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute);
        public string GetGraphic(Size viewBox, Color darkColor, Color lightColor, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute);
        public string GetGraphic(Size viewBox, string darkColorHex, string lightColorHex, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute);

        public enum SizingMode
        {
            WidthHeightAttribute = 0,
            ViewBoxAttribute = 1
        }
    }
}

thank you !

from qrcoder.

codebude avatar codebude commented on August 24, 2024

Hi Simon,

the "QrCode"-class has already an overload which takes a Bitmap-object which will be printed on the QrCode.

public Bitmap GetGraphic(int pixelsPerModule, Color darkColor, Color lightColor, Bitmap icon=null, int iconSizePercent=15, int iconBorderWidth = 6, bool drawQuietZones = true)

By passing the Bitmap icon to the GetGraphics method the icon will be printed. By changing the iconSizePercent parameter you can set up how much percent of the QrCode image will be covered by the icon (Min=1, Max=100). Please keep in mind that the higher this value is, the harder it is for QrCode readers to read out the QrCoder's payload.

from qrcoder.

codebude avatar codebude commented on August 24, 2024

Hi @iAmBipinPaul ,

the overload with the icon-parameter is only available for the "QRCode" rendering class. The "SvgQRCode"-class doesn't support icons right now. Have a look at this Wiki page to learn more about the different rendering classes: https://github.com/codebude/QRCoder/wiki/Advanced-usage---QR-Code-renderers

If you like to implement icon support for SvgQrCodes feel free to do so and sent a Pull Request later.

from qrcoder.

iAmBipinPaul avatar iAmBipinPaul commented on August 24, 2024

Hi @codebude ,
Thank you for you the info. I don't know about low level stuff for QR code (Image/SVG ) , I will try this when I will get free time and If it works will definitely send pull request.

from qrcoder.

hermanthotan avatar hermanthotan commented on August 24, 2024

Hi @iAmBipinPaul

Are you able to make similar to the starbucks qr code?
Can you share the code to produce that qr

from qrcoder.

iAmBipinPaul avatar iAmBipinPaul commented on August 24, 2024

Hi , @hermanthotan
I think I was able to place logo on qr code but not the svg.
but now I do not have access to the code so .

from qrcoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.