F
F
fierfoxik2018-07-07 23:59:25
Canvas
fierfoxik, 2018-07-07 23:59:25

How to add canvas dimensions to an image in a child component?

I'm trying to compare img and canvas images in a child component. In the parent only the inputs in which I get the image, then after receiving the image I create an img and pass it through the prop to the child component, and in the child component I already try to add the image to the canvas by setting its dimensions, but for some reason the canvas crops the image, in which could be the reason?

Judging by the console, all sizes are normal, but for some reason I don’t see the added sizes in html.

Link to codesandbox

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-07-08
@fierfoxik

replace
:style="{width: this.width, height: this.cavh}"
with
v-bind="{ width: width, height: cavh }"
or
:width="width" :height="cavh"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question