Socket
Socket
Sign inDemoInstall

rotate-canvas

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rotate-canvas

Rotate image canvas


Version published
Maintainers
1
Created

Readme

Source

rotate-canvas

Simple library to rotate canvas image using javascript. You can rotate image by 90, 180 or 270 degrees. Passing any other value will draw image/video without any rotation

Installation

To install run:

yarn add rotate-canvas
# or
npm i rotate-canvas

Example

import { drawRotated } from 'deviceorientation'

let video = document.querySelector('#video');
let canvas = document.querySelector('#canvas');
canvas.height = video.videoHeight;
canvas.width = video.videoWidth;
let ctx = canvas.getContext("2d");

drawRotated(video, canvas, ctx, 180);

Keywords

FAQs

Last updated on 31 Jul 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc