Comments (15)
You can set highlighting for important areas using highlighting
block in DSL builder.
from custom-qr-generator.
Ok thanks, I'll check that later. But I think it is something different. My background is already white.
I want single pixels to have that bright color, but none of the important pixels.
I could easily do this if the additional parameter was exposed.
And my solution would also allow for even more customization like having squares for the alignment patterns while having circles for the rest etc...
from custom-qr-generator.
It allows to set different shape and color for pixels from important areas. But its customization is limited. It probably can be extended
from custom-qr-generator.
The paint method of QrVectorColor ... should have an additional input parameter that gives some extra information about the current pixel.
It is impossible because in most of cases paint created for the whole dark/light pixels at once (not for one pixel). And QrVectorColor is a common interface for all types of paints like frames, balls, etc. May be it can provide info about the current component in general
from custom-qr-generator.
Makes sense. In theory wouldn't it be possible to just set this parameter to null/false/unavailable or something like that for all cases where all pixels are drawn at once?
But I am not too deep into your code, maybe there are more elegant solutions.
from custom-qr-generator.
Hi,
I now tried if the highlighting feature helps. But all I could achieve was that the pixels that are white anyway are highlighted now in a specific color. (purple in this example)
What I wanted to do though is to ensure that specific pixels are always black even though a color was used for the dark pixels (yellow in this example).
I also noticed that the 1 pixel frame of the version eye vanishes completely when highlighting is used. It doesn't really matter though as it doesn't help me in my situation anyway.
from custom-qr-generator.
I am actually very close now.
I changed my approach to have all dark pixels dark and add the accent color in the bright pixels.
So instead of turning some of the black pixels to yellow I turn some of the white pixels to yellow.
The highlighting feature can then be used to ensure some pixels stay white.
This way I was able to protect the eyes and the timing pattern, but I can't get the version eyes to look correct, as the highlight also overrides some of the dark pixels (the frame of the version eye).
from custom-qr-generator.
Highlighting will be extended in the next version and will allow to set shape and color of the highlighting as well as shape and color of the element being highlighted
from custom-qr-generator.
Currently shape of version eye aka alignment pattern is combined from frame
and ball
of corner eyes as well as its color as far as i remember
from custom-qr-generator.
the 1 pixel frame of the version eye vanishes completely
It is a result of applying rounded corner shape designed for 7-pixel eye to 5-pixel eye (bug). It works fine with other frame shapes
from custom-qr-generator.
This should help in 2.0.0-alpha01
if you rollback to random colors in dark pixels
highlighting {
timingLines = HighlightingType.Styled(
color = QrVectorColor.Unspecified,
elementShape = /*your dark pixel shape goes here*/,
elementColor = /*your dark pixel color without randomness goes here*/
)
versionEyes = HighlightingType.Styled(
color = QrVectorColor.Unspecified,
elementShape = QrVersionEyeShape(
frame = QrVectorFrameShape.AsPixelShape(
pixelShape = /*your dark pixel shape goes here. */,
size = 5
),
ball = /*your dark pixel shape goes here.
you can use same ball shape or call pixelShape.asBallShape() */
),
elementColor = /*your dark pixel color without randomness goes here*/
)
}
from custom-qr-generator.
Hi,
I tried to implement the changes, but had to leave for work before I was finished.
As I use the library from within java, my implementation alway looks a bit different.
Timing pattern highlight already worked like a charm!
I was about to do the versionEye highlight when I had to leave. But it seemed there was no QrVersionEyeShape() at all.
Anyway, I'll work on it again tomorrow.
Thanks for all your help!
from custom-qr-generator.
it seemed there was no QrVersionEyeShape() at all.
It's a function from QrHighlighting.kt so you have to use QrHighlightingKt.QrVersionEyeShape
i guess
from custom-qr-generator.
.asBallShape() is an extension from QVectorShapeUtils.kt (withourt 'r', wrongly named, will be changed)
from custom-qr-generator.
Hi,
everything works as expected!!
Thanks!
from custom-qr-generator.
Related Issues (20)
- Logo seems not cropped properly HOT 5
- Highlight anchor elements for better recognition
- Need option to make all eyes different colours HOT 3
- QrVectorLogo is not correctly showed HOT 2
- java.lang.IllegalArgumentException: width and height must be > 0 HOT 6
- com.google.zxing.WriterException HOT 5
- Documentation unclear about features HOT 7
- Add QrVectorPixelShape.Square(size) shape modifier HOT 3
- How to use your library draw QR codes with 3 vertices and circles? Looking forward to your reply HOT 5
- Support the different standard encodings HOT 7
- Customizing QR code after generation HOT 4
- Is the size of the positioning markings adjustable? HOT 4
- How to remove icon and background after choose them HOT 2
- How to custom gradient color and select background, logo from devices HOT 6
- Highlight anchor elements for better recognition seems break in Library version 2.0.0-alpha01 HOT 8
- add jetpack compose support to the library HOT 5
- Any Java samples? HOT 3
- Generated QR not scan-able HOT 6
- I run the app module of this project, and input "123" ,but it can't be scanned by other qr scanner. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from custom-qr-generator.