Blue Theme Orange Theme Green Theme Red Theme
 
Nevron Gauge for SharePoint
Home | Forums | ASP.NET 2.0 Tutorials | Web Services | How Do I...? | Class Browser | WPF Quick Starts | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
Search :       Advanced Search »
Home » Blogs Home » Blog Detail

Canvas Rotate Method in HTML5

 by Mahak Gupta on Jan 21, 2012

Canvas Rotate Method is used to rotate the Canvas.
Comments: 0 Views: 709 Printable Version 
Canvas Rotate Method is used to rotate the Canvas.It takes a parameter radians. We can set the degree of rotation by using the formula: 


For 10 degree:
10 * PI/180

<html>

<body>

 

<canvas id="myfirstcan" width="200" height="100" style="border:2px solid #FF00FF;">

 CANVAS</canvas>

 

<script type="text/javascript">

 

var canv=document.getElementById("myfirstcan");

var x=canv.getContext("2d");

x.rotate(10*Math.PI/180);

x.fillRect(20,30,100,20);

 

</script>

 

</body>

</html>



1234565.png




Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
 
What do you say about this post? Post a comment here
*Title:
*Comment:
 
Comments not available.
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor

 Blogger's Profile
Age: Not Available
Location:
Title: Developer
Joined: May 09, 2010
Education: Master's Degree
 More Blogs from this Blogger
No record available
 Latest Blogs
[Video] OnClose Handler
[Video] Storing and Loading the Window and Toolbar position
The Euclidean Algorithm
Swapping Exe Process
How Exe file is Generated by VS2005 C++ Project?
What is Exe
Header files: Multiple Inclusion problem - Solution B
Header files: Multiple Inclusion problem - Solution A
Header files: Multiple Inclusion problem - Reason
Header files: Multiple Inclusion problem
View all »
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 
6 Months Free & No Setup Fees ASP.NET Hosting!
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.