canvas

Return canvas (image) in openlayers 4

筅森魡賤 提交于 2020-01-07 03:56:12
问题 the example shows how to bind a button click event to the canvas and then it returns the image Example. How can I change it, that when I use a call openlayers with a permalink, that it automatically returns me that image? I would like to use a simple get request from an c++ programm to get the image. I have the e.g. "#map=12/1085115.28/6035092.46/0" as parsing parameters. Any ideas? Thanks and Greetings Melina So far I have the parameter parsing <!DOCTYPE html> <html> <head> <title

Facebook Extended permissions in canvas via php

旧巷老猫 提交于 2020-01-07 03:40:39
问题 I'm working on my new project, Woobook. I used the Old REST API until now but i should learn to work with latest one (with OAuth). First i want to get extended permissions but the attached code redirect me to a wrong page (instead of permissions dialog directly). My app link: http://apps.facebook.com/woobook/ and the source code: <?php // Facebook API inc require_once "inc/facebook.php"; // API init $cid = "162513840463126"; $asi = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; $facebook = new Facebook

web前端入门到实战:实现图形验证码

不问归期 提交于 2020-01-07 03:05:57
什么是图形验证码 图形验证码是验证码的一种。验证码(CAPTCHA)是“Completely Automated Public Turing test to tell Computers and Humans Apart”(全自动区分计算机和人类的图灵测试的缩写,是一种区分用户是计算机还是人的公共全自动程序。可以防止:恶意破解密码、刷票、论坛灌水,有效防止某个***对某一个特定注册用户用特定程序暴力破解方式进行不断的登陆尝试,实际上用验证码是现在很多网站通行的方式。 既然图形验证码是为了区分机器和人之间的操作,那么我们就可以在图形上绘制一个只有人可以解答的问题。比较常见的是在图片上生成文字验证码,然后用户输入图片上的文字吻合则验证通过。 虽然这种验证方法已经渐渐的被其他更先进的方法所淘汰了(图片上的文字依然可以被程序识别读取),并且前端生成验证码的方式相较于后端安全性不高,但我们的目的只是为了装x,提升程序的安全性只是附带的效果。 登录表单 首先我们需要在在登录表单上额外添加用于输入验证码的FormItem,并且给图形验证码提供一个canvas容器。有时候生成的验证码看不明白,因此需要给验证码添加点击事件用以切换验证码: web前端开发学习Q-q-u-n: ⑦⑧④-⑦⑧③-零①②,分享学习的方法和需要注意的小细节,不停更新最新的教程和学习方法(详细的前端项目实战教学视频)

Canvas loses style when I create Fabric.js canvas object

自作多情 提交于 2020-01-07 02:53:08
问题 I have a Canvas Object with top and left attributes defined through with a previous JavaScript function but when I create a fabric Canvas object var fabricCanvas= new fabric.Canvas('mycanvas'); my HTML Canvas has top and left attributes set on 0. I have tried setting the top and left attributes after the creation of fabric Canvas object through a script but when I do this the canvas changes position but the fabric function (selection and moving functions) remain where the canvas was located

Change background image in HTML5 canvas

前提是你 提交于 2020-01-07 02:18:09
问题 I need to change background image in HTML5 canvas. I want to use 2 different thumbnails as buttons and when I click on one of the images the background should be change to that particular image. 回答1: Technique 1 On click of the appropriate buttons set a unique CSS class on your <canvas> element. Use CSS to apply a background image to your canvas. Drawing commands and erasing your canvas will not affect the CSS-applied background image behind your content. Technique 2 Write a redraw() function

Change background image in HTML5 canvas

旧街凉风 提交于 2020-01-07 02:18:09
问题 I need to change background image in HTML5 canvas. I want to use 2 different thumbnails as buttons and when I click on one of the images the background should be change to that particular image. 回答1: Technique 1 On click of the appropriate buttons set a unique CSS class on your <canvas> element. Use CSS to apply a background image to your canvas. Drawing commands and erasing your canvas will not affect the CSS-applied background image behind your content. Technique 2 Write a redraw() function

Making Canvas Sprites Centered on Coordinates

懵懂的女人 提交于 2020-01-07 00:05:25
问题 I am working on a Canvas Game on HTML5 Canvas with Vanilla JS. For some reason I am noticing that when I set the player sprite to be drawn in at on the x-axis at x=0, the player appears indented to the right. (this appears to be disrupting my collision detection) I have the same issue with other sprites I have generated with the piskel app. Another sprite I used from another creator didn't have this issue. Does anyone have any suggestions? Here is a link to my game: http://zcbuhler.github.io

Canvas Image Shuffle

◇◆丶佛笑我妖孽 提交于 2020-01-06 21:06:22
问题 So I have a Canvas and a set of 18 Images in it and I want to shuffle the Images foreach (var myImg in GameCanvas.Children.OfType<Image>()) { GetTop.Add(Canvas.GetTop(myImg)); GetLeft.Add(Canvas.GetLeft(myImg)); listNum++; myImg.IsTapEnabled = false; } I have this part to add the Top and Left of each image in a separate list BUT when I try this foreach (var myImg in GameCanvas.Children.OfType<Image>()) { int ran = rand.Next(GetTop.Count); double Top = GetTop[ran]; double Left = GetLeft[ran];

Android: Change size of canvas / drawable in custom drawable

℡╲_俬逩灬. 提交于 2020-01-06 20:35:32
问题 I'm trying to implement a custom drawable which should have the shape of a speechbubble. Therefore I use two paths, one draws the rect and the other should draw the triangle for the bubble. My class looks like the following: public class SpeechBubbleView extends Drawable { private Paint mBubblePaint; private Paint mBubblePaint2; private Path mRectPath; private Path mBubblePath; public SpeechBubbleView() { } public void initPaint() { mBubblePaint = new Paint(Paint.ANTI_ALIAS_FLAG);

Android: Change size of canvas / drawable in custom drawable

荒凉一梦 提交于 2020-01-06 20:35:21
问题 I'm trying to implement a custom drawable which should have the shape of a speechbubble. Therefore I use two paths, one draws the rect and the other should draw the triangle for the bubble. My class looks like the following: public class SpeechBubbleView extends Drawable { private Paint mBubblePaint; private Paint mBubblePaint2; private Path mRectPath; private Path mBubblePath; public SpeechBubbleView() { } public void initPaint() { mBubblePaint = new Paint(Paint.ANTI_ALIAS_FLAG);