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

How To Render Rotation Image with drawImage Function?? #9

Open
Anastaufan opened this issue May 5, 2019 · 0 comments
Open

How To Render Rotation Image with drawImage Function?? #9

Anastaufan opened this issue May 5, 2019 · 0 comments

Comments

@Anastaufan
Copy link

Anastaufan commented May 5, 2019

I have continues this code with jquery.ui.rotatable.js and that work when I rotate image (clip art or text), the problem is how to render image with rotation.
I found this code, but it just resize and dragable render method. How To Render Rotation Image with drawImage function like this code :

`

function renderImage(ctx, element, image, bounds, borders) {
var paddingLeft = getCSSInt(element, 'paddingLeft'),
paddingTop = getCSSInt(element, 'paddingTop'),
paddingRight = getCSSInt(element, 'paddingRight'),
paddingBottom = getCSSInt(element, 'paddingBottom');
drawImage(
ctx,
image,
0, //sx posisi x
0, //sy posisi y
image.width, //sw
image.height, //sh
bounds.left + paddingLeft + borders[3].width, //dx
bounds.top + paddingTop + borders[0].width, // dy
bounds.width - (borders[1].width + borders[3].width + paddingLeft + paddingRight), //dw
bounds.height - (borders[0].width + borders[2].width + paddingTop + paddingBottom) //dh
);
}
`

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

1 participant