Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Convert Error when work with canvas #288

Closed
shaqtsui opened this issue Sep 22, 2013 · 4 comments
Closed

Type Convert Error when work with canvas #288

shaqtsui opened this issue Sep 22, 2013 · 4 comments
Assignees

Comments

@shaqtsui
Copy link

Seems the GeneratedWrapper can not work with canvas, it will cause type convertion error.

Env:
FireForx/Chrome + Polymer + Plupload

Code Example:
var ctx = canvas.getContext('2d');
var tmpCanvas = document.createElement('canvas');
ctx.drawImage(tmpCanvas, 0, 0, 1024, 1024, 0, 0, 251, 251);

Error Log:
Argument 1 of CanvasRenderingContext2D.drawImage could not be converted to any of: HTMLImageElement, HTMLCanvasElement, HTMLVideoElement.

@sorvell
Copy link
Contributor

sorvell commented Sep 23, 2013

+@arv

@sjmiles
Copy link
Contributor

sjmiles commented Sep 24, 2013

Try this:

var tmpCanvas = document.createElement('canvas');
var nativeCanvas = unwrap(tmpCanvas);
ctx.drawImage(nativeCanvas, 0, 0, 1024, 1024, 0, 0, 251, 251);

@arv
Copy link
Contributor

arv commented Sep 24, 2013

Someone needs to manually forward these. The canvas context API is pretty
large. Patches welcome.

On Mon, Sep 23, 2013 at 10:02 PM, Scott J. Miles
[email protected]:

Try this:

var tmpCanvas = document.createElement('canvas');var nativeCanvas = unwrap(tmpCanvas);ctx.drawImage(nativeCanvas, 0, 0, 1024, 1024, 0, 0, 251, 251);


Reply to this email directly or view it on GitHubhttps://github.com//issues/288#issuecomment-24974906
.

erik

@ghost ghost assigned dfreedm and ebidel Sep 24, 2013
@dfreedm
Copy link
Member

dfreedm commented Aug 12, 2014

This looks supported as of googlearchive/ShadowDOM@80b8152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants