Results 1 to 5 of 5

Thread: WebQrCode flickering

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Sweden
    Posts
    1,803

    Default WebQrCode flickering

    Hi,

    I have a cWebQrCode on a page and noticed that whenever something changes on the page, the QR code redraws. I have a label counting down from 30 via timer, so it looks horrible.

    In the resize function in WebQrCode.js, a redraw is made if the height or width changes. But it only saves the smallest of the height and width, so unless the clientWidth and clientHeight are identical, it will always think something changed and redraw.

    I changed it as below, to fixed it.

    Code:
    resize : function(){
        //  Forward Send (before so base class can add wrapping elements)
        WebQrCode.base.resize.call(this);
    
        var smallest = Math.min(this._eControl.clientWidth, this._eControl.clientHeight);
    
        // Redraw when neccessary
        if (this._eQrCode._htOption.width != smallest ||
            this._eQrCode._htOption.height != smallest){
    
            // For redraw
            this._eQrCode._htOption.height = smallest;
            this._eQrCode._htOption.width = smallest;
    
            // For direct resize
            this._eQrCode._oDrawing._elCanvas.height = smallest;
            this._eQrCode._oDrawing._elCanvas.width = smallest;
    
            // Draw the QR code
            this.makeCode(this.psValue);
        }
    
    },
    // Anders

  2. #2
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,465

    Default Re: WebQrCode flickering

    Anders,

    Is this about the PassPhrase example?
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

  3. #3
    Join Date
    Feb 2009
    Location
    Sweden
    Posts
    1,803

    Default Re: WebQrCode flickering

    Vincent,

    No, I've just included the DFSecurity library (1.1) and added a cWebQrCode control to our application.
    // Anders

  4. #4
    Join Date
    Jun 2011
    Location
    Switzerland
    Posts
    784

    Default Re: WebQrCode flickering

    Do you have multiple elements in the view with "pbFillHeight" = true? We sometimes have "race conditions" where multiple elements try to resize each other constantly.
    Currently working for transXpro (an online platform for a Swiss translation agency).
    Improved (unofficial) DataFlex Forum Search (now with SSL)

  5. #5
    Join Date
    Feb 2009
    Location
    Sweden
    Posts
    1,803

    Default Re: WebQrCode flickering

    Hi Raphael,

    Quote Originally Posted by Raphael Theiler View Post
    Do you have multiple elements in the view with "pbFillHeight" = true? We sometimes have "race conditions" where multiple elements try to resize each other constantly.
    No, there is only one such element (a tab container).
    // Anders

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •