canvas

Display canvas as gif for video preview

旧时模样 提交于 2019-12-25 05:20:10
问题 I'm working on a website and I am dealing with videos. My need is to display a gif a a preview / teaser for the videos on another page, that redirects to the video. What I found & added so far HTML <div id=thumbs></div> CSS #video {width:320px} JS var i =0; var video = document.createElement("video"); var thumbs = document.getElementById("thumbs"); video.addEventListener('loadeddata', function() { thumbs.innerHTML = ""; video.currentTime = i; }, false); video.addEventListener('seeked',

EaselJS Keyboard Ticker Problems

你说的曾经没有我的故事 提交于 2019-12-25 05:09:23
问题 I'm experimenting with EaselJS for the first time, and I'm trying to make a normal square move. I created used a Ticker to animate a square from the left to the right of the screen. It seemed choppy, so I raised the FPS of that ticker (via Ticker.setFPS(60) ). My next step is to add keyboard events to allow the square to move. I've done so successfully, but the same choppiness has come back. I've tried setting the FPS of the Ticker to a higher rate, which isn't fixing my problem at all. Here

How to draw a circle with a radial gradient on the canvas?

孤者浪人 提交于 2019-12-25 05:04:23
问题 I need to draw a circle with a radial gradient on the canvas in my custom control (XAML). But Windows::UI::Xaml::Media contains LinearGradientBrush only. I know about design guids but my control requires so feature to the user can see the color gamma. Below that I need to get: P.S. I ask how to draw it at least programmaticaly without XAML. P.P.S. I know that I can draw a picture in some editor with radial gradient and after draw it on the canvas but it seems not good solution for the

How to draw a circle with a radial gradient on the canvas?

…衆ロ難τιáo~ 提交于 2019-12-25 05:03:12
问题 I need to draw a circle with a radial gradient on the canvas in my custom control (XAML). But Windows::UI::Xaml::Media contains LinearGradientBrush only. I know about design guids but my control requires so feature to the user can see the color gamma. Below that I need to get: P.S. I ask how to draw it at least programmaticaly without XAML. P.P.S. I know that I can draw a picture in some editor with radial gradient and after draw it on the canvas but it seems not good solution for the

微信电子健康卡——实现前端上传身份证通过身份证OCR接口读取身份证数据

爷,独闯天下 提交于 2019-12-25 04:46:57
页面代码: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Regist_new.aspx.cs" Inherits="SysFrameWeb.View.ViewChat.Regist_new" %> <!DOCTYPE html> <html> <head> <title>电子健康卡</title> <%-- <script type="text/javascript" src="https://js.aq.qq.com/js/aq_common.js"></script>--%> <meta charset="utf-8" /> <meta name="format-detection" content="telephone=no" /> <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> <meta name="mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /

Trying to get a canvas to follow another canvas, it goes crazy

烂漫一生 提交于 2019-12-25 04:42:48
问题 Okay. I'm having two canvases. First canvas (rect1) is going to be moving randomly on the gameboard. The second (zombie) is supposed to follow rect1, but it just runs all over the place. Here is the most important code which I think should be enough to spot out what is wrong. var rect1={ x:300, y:150, width:8, velX:3, velY:3 }; var zombie={ x: 100, y: 100, width: 10, velX: 3, velY: 3 }; if (zombie.x > rect1.x){ zombie.velX *= -1; } if (zombie.y > rect1.y){ zombie.velY *= -1; } if (zombie.x ==

Trying to get a canvas to follow another canvas, it goes crazy

折月煮酒 提交于 2019-12-25 04:42:27
问题 Okay. I'm having two canvases. First canvas (rect1) is going to be moving randomly on the gameboard. The second (zombie) is supposed to follow rect1, but it just runs all over the place. Here is the most important code which I think should be enough to spot out what is wrong. var rect1={ x:300, y:150, width:8, velX:3, velY:3 }; var zombie={ x: 100, y: 100, width: 10, velX: 3, velY: 3 }; if (zombie.x > rect1.x){ zombie.velX *= -1; } if (zombie.y > rect1.y){ zombie.velY *= -1; } if (zombie.x ==

Why does the clip method work wrong into last versions of Chrome?

馋奶兔 提交于 2019-12-25 04:34:21
问题 I have a codepen http://codepen.io/artzub/pen/oXaVpz, which demonstrates how to use the clip method of Canvas with images. // some code before // ... l = nodes.length; ctx.save(); while(l--) { item = nodes[l]; ctx.beginPath(); ctx.arc(item.x, item.y, 30, 0, 2*Math.PI); ctx.closePath(); ctx.stroke(); ctx.fill(); if (groupImg[item.group]) { ctx.save(); ctx.clip(); ctx.drawImage(groupImg[item.group], item.x - 30, item.y - 30, 60, 60); ctx.restore(); } } ctx.restore(); But into the last versions

Skew the drawing horizontally and vertically in html5 canvas using mouse

别来无恙 提交于 2019-12-25 04:31:23
问题 In my code I am loading images to canvas element. Then I need to drag, resize, rotate and skew it. I managed to implement both dragging and resizing. How can I implement skew using mouse on this code? I read a helpful article on this subject (http://www.subshell.com/en/subshell/blog/image-manipulation-html5-canvas102.html). I found fabricjs plugin, but it work only one image and without drag. For example: http://fabricjs.com/matrix-transformation/ . If you will use the transform function: ctx

Skew the drawing horizontally and vertically in html5 canvas using mouse

旧时模样 提交于 2019-12-25 04:31:22
问题 In my code I am loading images to canvas element. Then I need to drag, resize, rotate and skew it. I managed to implement both dragging and resizing. How can I implement skew using mouse on this code? I read a helpful article on this subject (http://www.subshell.com/en/subshell/blog/image-manipulation-html5-canvas102.html). I found fabricjs plugin, but it work only one image and without drag. For example: http://fabricjs.com/matrix-transformation/ . If you will use the transform function: ctx