Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Canvas blur filter?
Forum Updated to NodeBB v4.3 + New Features

Canvas blur filter?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 1.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CKurduC Offline
    CKurduC Offline
    CKurdu
    wrote on last edited by CKurdu
    #1

    Hi everybody,
    HTML based canvas has filter properties and methods. You can find at this link.

    I also need blur effect on Canvas element of Qt Quick. Below code doesn't create error also does not work. ctx.b is a Context2d element

        ctx.b.save();
        ctx.b.filter = 'blur(18px)';
        ctx.b.globalCompositeOperation = 'lighten';
        ctx.b.drawImage(canvas.a, 0, 0);
        ctx.b.restore();
    
    

    It seems Context2D QML doesn't support filters. How can I create a blur effect without the filter?
    You can find a full example is here at 178 line in ether.js.

    Thanks.

    You reap what you sow it

    raven-worxR 1 Reply Last reply
    0
    • CKurduC CKurdu

      Hi everybody,
      HTML based canvas has filter properties and methods. You can find at this link.

      I also need blur effect on Canvas element of Qt Quick. Below code doesn't create error also does not work. ctx.b is a Context2d element

          ctx.b.save();
          ctx.b.filter = 'blur(18px)';
          ctx.b.globalCompositeOperation = 'lighten';
          ctx.b.drawImage(canvas.a, 0, 0);
          ctx.b.restore();
      
      

      It seems Context2D QML doesn't support filters. How can I create a blur effect without the filter?
      You can find a full example is here at 178 line in ether.js.

      Thanks.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @CKurdu
      you even provide a link to the docs and didn't even check if there is a filter property?! o.O

      To come to your question, you can create a blur effect on the whole Canvas element.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      CKurduC 1 Reply Last reply
      0
      • raven-worxR raven-worx

        @CKurdu
        you even provide a link to the docs and didn't even check if there is a filter property?! o.O

        To come to your question, you can create a blur effect on the whole Canvas element.

        CKurduC Offline
        CKurduC Offline
        CKurdu
        wrote on last edited by CKurdu
        #3

        @raven-worx said in Canvas blur filter?:

        you even provide a link to the docs and didn't even check if there is a filter property?! o.O

        Actually, I have realized it later, and I tried it but it doesn't give the same view as original javascript one. I think it is related to my code or maybe qt and html5 are using different algorithms. I don't know exactly.

        Thank you for your response.

        You reap what you sow it

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved