proposed changes

Oct 13, 2011 at 5:32 PM
Edited Oct 13, 2011 at 5:32 PM

Hi,

First of all: Nice code!!

I would like to see/propose some changes:

* Modulesize as a property of the QRCodeControl (runtime changeable)
* ErrorCorrectionLevel as property of the QRCodeControl (runtime changeable)
* The control moved to the assembly (it's now inside the executable).
* Rename Size/Point etc so they do not clash with System.Drawing.
  It makes it difficult to move the QRCodeControl into the assembly.

Oct 13, 2011 at 5:57 PM
Edited Oct 13, 2011 at 5:58 PM

Hi,

I added the following code to the QRCodeControl (and removed the readonly from some fields):

        public ErrorCorrectionLevel ErrorCorrection
        {
            get
            {
                return m_Encoder.ErrorCorrectionLevel;
            }
            set
            {
                m_Encoder = new QrEncoder(value);
                m_QrCode = m_Encoder.Encode(Text);

                AdjustSize();

                Invalidate();
            }
        }

        private int fModuleSize = 7;
        public int moduleSize
        {
            get
            {
                return fModuleSize;
            }
            set
            {
                fModuleSize = value;

                m_Renderer = new Renderer(fModuleSize);

                AdjustSize();

                Invalidate();
            }
        }
    }

It seems to do the trick (except the dotted outline of the control is not auto sized).

Furthermore did i move the code into the assembly project and 
solved some of the clashes with System.Draw.
Coordinator
Oct 13, 2011 at 6:55 PM

Yes, makes sense. I think we should adopt all of your proposals. By the way feel free to create issues here  http://qrcodenet.codeplex.com/workitem/list/basic

You can also just join us and contribute http://qrcodenet.codeplex.com/team/view

Coordinator
Oct 20, 2011 at 4:01 AM

Done rename for Point and Size. 

Probably won't add property for QRCodeControl until we finish implement our own code. As QRCodeControl is currently using ZXing's code to generate QRCode. That control is for demo only at current stage. 

Coordinator
Oct 21, 2011 at 12:09 AM

Just add those attribute to QR Code Control. 

One thing must beware, Artistic only available when ErrorCorrectionLevel = High. I have written some code to prevent Artistic to be set up unless ErrorCorrectionLevel is set up to high. Also it will reset to false if you change ErrorCorrectionLevel to lower value. 

I have also add QuietZoneModules attribute. Default according to ISO it should be four. But sometime people might prefer set up as two.  You can find description for Quiet Zone at Chapter 7.3.7, Page 13.  (ISO/IEC 18004 2000)

Also you can edit those attribute under design properties window. 

I will try to move them over to Encoding assembly later. 

 

Regard

Coordinator
Oct 21, 2011 at 5:19 AM

QR Code Control is now under Encoder.Windows.Controls.

Also I have renamed Rectangle. As it is same as "Point" and "Size" conflict with Drawing class. 

Jan 20, 2012 at 5:53 AM
Edited Jun 2, 2015 at 8:52 AM
Thank you for exploring the world of QR Codes in your blog. Letting people know about them I'd the first link to making them mainstream. Please visit my QRCode resource website for a free ecourse QR Code generator and QR Code Reader,