canvas̳

[ Qt ѧϰ֮· 2 ](2)

ֺ+ ߣH5֮ ԴH5֮ 2017-03-21 12:02 Ҫ( )

ȣ #333 һΡεʼλԭ㣬ȺͿȷֱ󶨵ijȺͿȡӰԡıΪ 80 ؼӴֵ sans-serifˡEarthʡ

ȣ #333 һΡεʼλԭ㣬ȺͿȷֱ󶨵ijȺͿȡӰԡıΪ 80 ؼӴֵ sans-serifˡEarthʡнʾ
canvas Ӱ
ע۲ĸԱߵķЧʵʹӰġ

ͼ

CanvasԪִ֧ӶԴͼΪ˻ͼҪȼͼʹComponent.onCompleted¼ԴﵽһĿģ

onPaint: { var ctx = getContext("2d") // ͼ ctx.drawImage('assets/earth.png', 10, 10) // 浱ǰ״̬ ctx.save() // ƽϵ ctx.translate(100,0) ctx.strokeStyle = 'red' // üΧ ctx.beginPath() ctx.moveTo(10,10) ctx.lineTo(55,10) ctx.lineTo(35,55) ctx.closePath() ctx.clip() // ·ü // ͼӦòü ctx.drawImage('assets/earth.png', 10, 10) // · ctx.stroke() // ָ״̬ ctx.restore() } Component.onCompleted: { loadImage("assets/earth.png") }

н£
canvas image
ĵͼϽΪ (10, 10) λãҲͼӦ·üͼ·Ա·üֻʹclip()ɡøú֮еĻƶ·УҲνüüڻָϴ״̬ʱȡ

һƪ һƪ

1.վѭҵ淶κתصĸȷעߺԴ2.վԭ£תʱעߺԴԭΪǽ׷Σ3.ͶܻᾭDZ༭޸Ļ򲹳䡣

  • AR+MOOCѧϰ龳AR ѧ

    AR+MOOCѧϰ龳AR ѧ

    2017-03-21 13:00

  • Android ԶViewѧϰ()

    Android ԶViewѧϰ()

    2017-03-21 11:02

  • Silverlight/WPF/Windows Phone/HTML5һѧϰ(213

    Silverlight/WPF/Windows Phone/HTML5һѧϰ(213

    2017-03-20 12:01

  • HTML5̳̻Canvas֪ʶ⣬html5ѧϰ

    HTML5̳̻Canvas֪ʶ⣬html5ѧϰ

    2017-03-14 09:01

ѵ
v