[Interest] Anti-aliasing for QML Canvas on Windows?

guillaume.belz at free.fr guillaume.belz at free.fr
Mon Mar 11 20:31:15 CET 2013


Hi, 

Sorry for delay, I had not seen your question 
To enable antialiasing in Qt Quick Canvas , you must set the property " antialiasing " to "true" and set the property "renderTarget" to "Canvas.Image" 
Guillaume 

On Fri, Feb 15, 2013 at 7:49 PM, Mark < markg85 at gmail.com > wrote:
> Hi, > > I'm drawing some shapes on Windows 7 with QML Canvas, but the output > really seems aliased as in the anti-aliasing is off. > > The code: > > import QtQuick 2.0 > > Item { > width: 400 > height: 400 > > Canvas { > id:canvas > width:400 > height:400 > antialiasing: true > > property string strokeStyle:"green" > property string fillStyle:"yellow" > property int lineWidth:10 > property bool fill:true > property bool stroke:true > > > onPaint: { > var ctx = canvas.getContext('2d'); > ctx.save(); > ctx.clearRect(0, 0, canvas.width, canvas.height); > ctx.strokeStyle = canvas.strokeStyle; > ctx.fillStyle = canvas.fillStyle; > ctx.lineWidth = canvas.lineWidth; > > ctx.arc(75,75,50,0,Math.PI*2,true); // Outer circle > > if (canvas.fill) > ctx.fill(); > if (canvas.stroke) > ctx.stroke(); > > ctx.restore(); > } > } > } > > I'm using Qt 5.0.1 mingw build x86 on Windows 7. > > Cheers, > Mark Anyone?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130311/05f0ada7/attachment.html>


More information about the Interest mailing list