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

ImageEditor 竟然没有导出为png的方法啊!!!!! #18

Open
evenle opened this issue Dec 3, 2015 · 3 comments
Open

ImageEditor 竟然没有导出为png的方法啊!!!!! #18

evenle opened this issue Dec 3, 2015 · 3 comments

Comments

@evenle
Copy link

evenle commented Dec 3, 2015

/**
* 导出base64 png数据
*/
_public.toDataPngURL = function (callback) {
var self = this;
// 去除编辑状态的元素
self.unSelect();
window.setTimeout(function () {
var data = self.canvas.toDataURL("image/png");
callback.call(self, data);
}, 1000 / self.config.fps)
}

自己再后面加了这个方法,不知道你们会不会觉得不好~~

@evenle
Copy link
Author

evenle commented Dec 3, 2015

/*
var bg = new Q.Graphics({
width: config.width,
height: config.height
});
bg.beginFill("#fff").drawRect(0, 0, config.width, config.height).endFill().cache();
self.stage.addChild(bg)
*/

还要把这个注释掉~~

@mamboer
Copy link
Contributor

mamboer commented Jan 29, 2016

@cnwander 啵啵关注下

@cnwander
Copy link
Contributor

toDataURL在qq浏览器下获取不到数据,所以现在用的是JPEGEncoder,可以用下PNGEncoder

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

3 participants