canvas

EaselJS perspective image transformation

99封情书 提交于 2020-01-02 11:31:57
问题 Is it possible to make perspective image transformation in html5 canvas? I am using EaselJS right now and can't find a solution for my need. 回答1: I don't tried the easel.js yet, but every image transformation is done with matrix operations: translate, rotate, skew etc. Looking on the easel.js source code there is a Matrix2D class, and the documentation to it: http://www.createjs.com/Docs/EaselJS/Matrix2D.html. For a perspective transformation you need to use rotation , scaling and skewing .

EaselJS perspective image transformation

僤鯓⒐⒋嵵緔 提交于 2020-01-02 11:31:10
问题 Is it possible to make perspective image transformation in html5 canvas? I am using EaselJS right now and can't find a solution for my need. 回答1: I don't tried the easel.js yet, but every image transformation is done with matrix operations: translate, rotate, skew etc. Looking on the easel.js source code there is a Matrix2D class, and the documentation to it: http://www.createjs.com/Docs/EaselJS/Matrix2D.html. For a perspective transformation you need to use rotation , scaling and skewing .

HTML5 Canvas API italic word

末鹿安然 提交于 2020-01-02 10:19:33
问题 I have a small problem using Canvas API in HTML5. I have a text that I have to show on a canvas in an html page. The text example can be "This is an Italic word". So what I have to do is display this text that I take from the database, but to make just one word from the sentence Italic. So I have to display the text like this: "This is an Italic word" So my code looks like this: <script> var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); //text context

Snap-To lines when aligning controls at Runtime

戏子无情 提交于 2020-01-02 09:31:37
问题 I have an app where users can drag controls around on a Form. But they re asking me for Snap-To lines to make the alignment of controls easier. I have no idea about the snep-to lines and how to implement them - I have looked at: http://msdn.microsoft.com/en-us/library/ms752100.aspx Adorner's, but it says it's only for WPF. And I tried it in WinForms but (as expected) didn't work. How can I get snap-to lines (something like the ones in VS) in my app? Thank you Bael 回答1: Have you seen this

Convert PictureStream to HTML5 canvas

柔情痞子 提交于 2020-01-02 08:30:27
问题 I am retrieving a byte array of a pictureStream from a .net webservice. the JSON byte array response looks like this: [137, 80, 78, 372, 617 more...] I am trying to convert this byte array and draw it into an HTML canvas like this var context = document.getElementById('boxcover').getContext('2d'); context.putImageData(movies.PictureStream, 0, 0); But this doesn't work. I have no access the modify the webservice, so I am looking to convert this byte array into a picture using Javascript only.

SECURITY_ERR: DOM Exception 18 ONLY IN Safari

痞子三分冷 提交于 2020-01-02 08:30:08
问题 i got two servers (prod.example.com and img.example.com) so on "prod" i process images from "img" using canvas in FF and Chrome all is Ok but in Safari i got this SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent. all images from "img" has Access-Control-Allow-Origin:* in headers so where is padla? 回答1: getImageData which you probably call will raise this if you try to access the one host from the other. You cannot go around this, the

Prezi-like web interface. Flash or HTML5?

て烟熏妆下的殇ゞ 提交于 2020-01-02 08:22:15
问题 I would like to write a web interface that resembles Prezi.com in its user experience. What would be the best technology for that purpose? Project requirements: Fast implementation (it is a demo) - I'd appreciate a rough estimate Large amounts of data - dynamic content loading/unloading is required. My natural candidates are Flash and HTML5. Prezi.com is an alternative platform for presentations that uses single canvas zoom/pan/rotate controls instead of classic slide-by-slide interface. An

Image being saved from canvas is not rendered properly

白昼怎懂夜的黑 提交于 2020-01-02 08:11:14
问题 I'm trying to use the following code to save the contents of myCanvas as an image file in the gallery (for Windows Phone 8.1, not Silverlight). When I run the App, the image is saved but it is distorted. What am I doing wrong? I have uploaded the resultant image and the expected result. public async void SaveFileToPhone() { var file = await KnownFolders.PicturesLibrary.CreateFileAsync("bug.png", CreationCollisionOption.GenerateUniqueName); await SaveVisualElementToFile(myCanvas, file); }

Image being saved from canvas is not rendered properly

谁说我不能喝 提交于 2020-01-02 08:11:05
问题 I'm trying to use the following code to save the contents of myCanvas as an image file in the gallery (for Windows Phone 8.1, not Silverlight). When I run the App, the image is saved but it is distorted. What am I doing wrong? I have uploaded the resultant image and the expected result. public async void SaveFileToPhone() { var file = await KnownFolders.PicturesLibrary.CreateFileAsync("bug.png", CreationCollisionOption.GenerateUniqueName); await SaveVisualElementToFile(myCanvas, file); }

How do I put custom fonts into HTML5 Canvas easily?

江枫思渺然 提交于 2020-01-02 08:05:34
问题 When looking through the questions I never found a clear answer to the above. I wanted a method that worked with just about every platform. So for the benefit of the community, I thought I'd share my success in getting custom fonts to work in canvas. My main question was, What is a surefire way to get said fonts to work? I tried multiple methods such as just using a CSS stylesheet but it's a bit more complicated than that. Here's what I found: 回答1: Although it doesn't have complete support