|
For length of text that can be encode by encoder, you can check ISO/IEC 18004:2006 Page 33, Table 7. (Document you can download from front page of this project)
If all your character is English and upper case, it can fit 4296 characters inside, else will be around 2953 characters(For version 40). It really depends what character contain inside your input string.
As you can see on that table, QrCode has numbers of different encode method, It can not tell you exactly how many characters it can fit. Only during process. TryEncode method is the one catch exception and tells developer either input string is empty, null
or string is too large. While for method "Encode" you have to try-catch on your own.
InputOutOfBoundaryException << This is what encoder use for report string empty, null or can not fit.
It is possible to add method that return how many codewords you can fit to specific version of QrCode, but not how many characters as I have explained at start. One codeword = 1 byte = 8 bits. To determine how many char it can fit we have to see which char
encode we will be using and how many codeword we have after encode, also check if it need ECI header and normal header's size depend on version. It's very complicate process.
For QrCode control. Which one do you use? There are two different kind of control. If you use QrCodeImgControl, that one just act like Winform's PictureBox. It can stretch image and make it always at middle of that control. Just remember to set up proper
module size, so it won't consume too much memory.
I'm not sure what left|middle|right means.
Do you mean QrCode hug left side or right side without QuietZone? Technically we can not create any QrCode without QuietZone, that way we can make sure every code can be proper decoded. As ISO/IEC state, we need 4 modules wide for QuietZone, but as in reality
2 modules wide normally is enough. That's why we have provide property to change QuietZone between 4 modules and 2 modules. (QuietZone is present by white brush, same as 0 module inside QrCode).
As our default control doesn't have background, so it will be either expand code from position (0, 0), or act like PictureBox, stretch image. Size of control always exactly what QrCode needs or try to fit your config by stretch image. Thus there is no need
for position properties.
If you want paint it on some background, we do provide full support for offset position rendering inside Renderer class which locate with control.
Sorry for un-detailed documentation. I might put some work on it later.
Regard
Silverlancer
|