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. Draw faded/feathered stroke line
Forum Updated to NodeBB v4.3 + New Features

Draw faded/feathered stroke line

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 208 Views
  • 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.
  • E Offline
    E Offline
    eragon
    wrote on last edited by eragon
    #1

    Hello,

    Is it possible to draw a line that is faded/feathered like the below image? The blue line is slightly featured/blurred.

    0_1545998809957_Capture.JPG

    
    Item {
    
        Canvas {
            id: foregroundCanvas
            anchors.fill: parent
            visible: true
    
            onPaint: {
                var ctx = getContext("2d");
                ctx.reset();
                ctx.beginPath();
                ctx.moveTo(0.02*width,0);
                ctx.lineTo(0.02*width, 0.1*height);
                ctx.lineTo(0.95*width, 0.1*height);
                ctx.lineTo(0.95*width, 0);
                ctx.lineWidth = 3;
                ctx.strokeStyle = "#3098B1";
                ctx.stroke();
            }
        }
    }
    
    
    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