Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I have square cells with custom finderPatternImage? #427

Open
JacobM8 opened this issue Oct 20, 2022 · 1 comment
Open

How do I have square cells with custom finderPatternImage? #427

JacobM8 opened this issue Oct 20, 2022 · 1 comment

Comments

@JacobM8
Copy link

JacobM8 commented Oct 20, 2022

Type of issue

[ ] Bug
[x] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement

How do I have square cells with custom finderPatternImage?

@koaqiu
Copy link
Contributor

koaqiu commented Oct 5, 2023

复制一份ArtQrCode为DiyQrCode,然后使用新的DiyQrCode。
修改

                                if (!IsPartOfFinderPattern(x, y, numModules, offset))
                                    if (drawQuietZones && quietZoneRenderingStyle == QuietZoneStyle.Flat && IsPartOfQuietZone(x, y, numModules))
                                        graphics.FillRectangle(solidBrush, rectangleF);
                                    else
                                        graphics.DrawImage(pixelImage, rectangleF);
                                else if (finderPatternImage == null)
                                    graphics.FillRectangle(solidBrush, rectangleF);

                                if (!IsPartOfFinderPattern(x, y, numModules, offset)){
                                        graphics.FillRectangle(solidBrush, rectangleF);
                                }else if (finderPatternImage == null){
                                    graphics.FillRectangle(solidBrush, rectangleF);
}

另外还有一个BUG,修改

                        if (finderPatternImage != null)
                        {
                            var finderPatternSize = 7 * pixelsPerModule;
                            graphics.DrawImage(finderPatternImage, new Rectangle(0, 0, finderPatternSize, finderPatternSize));
                            graphics.DrawImage(finderPatternImage, new Rectangle(size - finderPatternSize, 0, finderPatternSize, finderPatternSize));
                            graphics.DrawImage(finderPatternImage, new Rectangle(0, size - finderPatternSize, finderPatternSize, finderPatternSize));
                        }

                        if (finderPatternImage != null) {
                            var finderPatternSize = 7 * pixelsPerModule;
                            var finderPatternOffset = drawQuietZones ? 4 * pixelsPerModule : 0;
                            graphics.DrawImage(finderPatternImage, new Rectangle(finderPatternOffset, finderPatternOffset, finderPatternSize, finderPatternSize));
                            graphics.DrawImage(finderPatternImage, new Rectangle(size - finderPatternOffset - finderPatternSize, finderPatternOffset, finderPatternSize, finderPatternSize));
                            graphics.DrawImage(finderPatternImage, new Rectangle(finderPatternOffset, size - finderPatternOffset - finderPatternSize, finderPatternSize, finderPatternSize));
                        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants