All Projects → iddan → React Native Canvas

iddan / React Native Canvas

A Canvas component for React Native

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Canvas

Gcanvas
A lightweight cross-platform graphics rendering engine. (超轻量的跨平台图形引擎) https://alibaba.github.io/GCanvas
Stars: ✭ 1,705 (+131.66%)
Mutual labels:  graphics, canvas
Mesh.js
A graphics system born for visualization 😘.
Stars: ✭ 156 (-78.8%)
Mutual labels:  graphics, canvas
Sprite Wxapp
spritejs 小程序版
Stars: ✭ 138 (-81.25%)
Mutual labels:  graphics, canvas
Lowpoly
Lowpoly image generator
Stars: ✭ 83 (-88.72%)
Mutual labels:  graphics, canvas
Pts
A library for visualization and creative-coding
Stars: ✭ 4,628 (+528.8%)
Mutual labels:  graphics, canvas
G2
📊 A highly interactive data-driven visualization grammar for statistical charts.
Stars: ✭ 11,020 (+1397.28%)
Mutual labels:  graphics, canvas
Wechart
Create all the [ch]arts by cax or three.js - Cax 和 three.js 创造一切图[表]
Stars: ✭ 152 (-79.35%)
Mutual labels:  graphics, canvas
Hilo3d
Hilo3d, a WebGL Rendering Engine.
Stars: ✭ 123 (-83.29%)
Mutual labels:  graphics, canvas
Vue Konva
Vue & Canvas - JavaScript library for drawing complex canvas graphics using Vue.
Stars: ✭ 682 (-7.34%)
Mutual labels:  graphics, canvas
Rough
Create graphics with a hand-drawn, sketchy, appearance
Stars: ✭ 16,472 (+2138.04%)
Mutual labels:  graphics, canvas
Core
A canvas-based super high performant grid renderer API
Stars: ✭ 857 (+16.44%)
Mutual labels:  graphics, canvas
Silk.net
The high-speed OpenAL, OpenGL, Vulkan, and GLFW bindings library your mother warned you about.
Stars: ✭ 534 (-27.45%)
Mutual labels:  graphics, native
Plutovg
Tiny 2D vector graphics library in C
Stars: ✭ 141 (-80.84%)
Mutual labels:  graphics, canvas
Picasso
Picasso is a high quality 2D vector graphic rendering library. It support path , matrix , gradient , pattern , image and truetype font.
Stars: ✭ 205 (-72.15%)
Mutual labels:  graphics, canvas
Dearpygui
Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
Stars: ✭ 6,631 (+800.95%)
Mutual labels:  graphics, native
Konva
Konva.js is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
Stars: ✭ 6,985 (+849.05%)
Mutual labels:  graphics, canvas
Map Canvas
基于baidu、google、openlayers、arcgis、高德地图、canvas数据可视化
Stars: ✭ 665 (-9.65%)
Mutual labels:  canvas
Anki 3d Engine
AnKi 3D Engine - Vulkan backend, modern renderer, scripting, physics and more
Stars: ✭ 688 (-6.52%)
Mutual labels:  graphics
Blurify
blurify.js is a tiny(~2kb) library to blurred pictures, support graceful downgrade from `css` mode to `canvas` mode.
Stars: ✭ 665 (-9.65%)
Mutual labels:  canvas
Hilo
A Cross-end HTML5 Game development solution developed by Alibaba Group
Stars: ✭ 5,723 (+677.58%)
Mutual labels:  canvas

react-native-canvas

A Canvas component for React Native

npm install react-native-webview
react-native link react-native-webview
npm install react-native-canvas

Usage

import React, { Component } from 'react';
import Canvas from 'react-native-canvas';

class App extends Component {

  handleCanvas = (canvas) => {
    const ctx = canvas.getContext('2d');
    ctx.fillStyle = 'purple';
    ctx.fillRect(0, 0, 100, 100);
  }

  render() {
    return (
      <Canvas ref={this.handleCanvas}/>
    )
  }
}

API

Canvas

Canvas#height

Reflects the height of the canvas in pixels

Canvas#width

Reflects the width of the canvas in pixels

Canvas#getContext()

Returns a canvas rendering context. Currently only supports 2d context.

Canvas#toDataURL()

Returns a Promise that resolves to DataURL.

CanvasRenderingContext2D

Standard CanvasRenderingContext2D. MDN. Only difference is await should be used to retrieve values from methods.

const ctx = canvas.getContext('2d');

Image

WebView Image constructor. Unlike in the browsers accepts canvas as first argument. MDN

const image = new Image(canvas, height, width);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].