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

keep the orginanl image resoluting and support generating retina image #1039

Closed
wants to merge 1 commit into from

Conversation

haoqi0818
Copy link

now i can use this way to generate a final retina image, however i found that all of the image element become blurry.

html2canvas(el, {
    canvas: (function() {
        // 生成多倍图
        var ratio = 2;
        var canvas = document.createElement('canvas');
        canvas.width = document.documentElement.clientWidth * ratio;
        canvas.height = document.documentElement.clientHeight * ratio;
        var ctx = canvas.getContext('2d');
        ctx.scale(ratio, ratio);
        return canvas;
    })()
})

change function "CanvasRenderer.prototype.renderBackgroundRepeat" can fix this problem

@haoqi0818 haoqi0818 changed the title keep the orginanl image resolutiong and support generating retina image keep the orginanl image resoluting and support generating retina image Jan 17, 2017
@niklasvh niklasvh closed this Jul 28, 2017
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

Successfully merging this pull request may close these issues.

2 participants