Rotate Image

Developer
Size
1,843 Kb
Views
48,576

How do I make an rotate image?

Rotate an NxN image by 90 degrees.. What is a rotate image? How do you make a rotate image? This script and codes were developed by Mnicpt on 30 July 2022, Saturday.

Rotate Image Previews

Rotate Image - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Rotate Image</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="console"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Rotate Image - Script Codes JS Codes

function rotateClockwise90(matrix) { var i = 0, layer = 0, top, offset; for (layer; layer < matrix.length / 2; layer++) { var first = layer; var last = matrix.length - 1 - layer; for (i = first; i < last; i++) { offset = i - first; //save top top = matrix[first][i]; //left -> top matrix[first][i] = matrix[last - offset][first]; //bottom -> left matrix[last - offset][first] = matrix[last][last - offset]; //right -> bottom matrix[last][last - offset] = matrix[i][last]; //top -> right matrix[i][last] = top; } } return matrix;
}
var console = document.querySelector(".console"), rotatedMatrix, matrix = [[1,2,3,4], [5,6,7,8], [9,10,11,12], [13,14,15,16]];
rotatedMatrix = rotateClockwise90(matrix);
console.innerHTML = rotatedMatrix;
Rotate Image - Script Codes
Rotate Image - Script Codes
Home Page Home
Developer Mnicpt
Username mnicpt
Uploaded July 30, 2022
Rating 3
Size 1,843 Kb
Views 48,576
Do you need developer help for Rotate Image?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Mnicpt (mnicpt) Script Codes
Create amazing captions with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!