The background of the PPT is quite nice. In fact, some are images and some are gradient images. Today I tried to make a progressive PPT background image (for special purposes ), the radial gradient rectangle of canvas is used. In fact, there is nothing special.CodeRight
View code
<! Doctype html > < Html > < Head > < Meta Charset = "UTF-8" > < Title > Canvas </ Title > < Meta Name = "Keywords" Content = "Canvas" > < Meta Name = "Description" Content = "Canvas HTML5" > </ Head > < Style Type = "Text/CSS" > Canvas { Border : Dashed 1px # ccc } </ Style > < Script Type = "Text/JavaScript" > Function $ (ID ){ Return Document. getelementbyid (ID );} Function Pageload (){ VaR Can = $ ( ' Can ' ); VaR Cans = Can. getcontext ( ' 2d ' ); VaR Gnt1 = Cans. createradialgradient ( 600 , 300 , 0 , 400 , 700 , 800 ); Gnt1.addcolorstop ( 1 , ' # Bdbdbd ' ); Gnt1.addcolorstop ( 0 , ' # F3f3f3 ' ); Cans. fillstyle = Gnt1; cans. fillrect ( 0 , 0 , 800 , 600 ); Cans. Fill ();} </ Script > < Body Onload = "Pageload ();" > < Canvas ID = "Can" Width = "800px" Height = "600px" > </ Canvas > </ Body > </ Html >
Previous