You can try it:
in view:
function update() {
var url = '{{=URL(f="update",args=request.args,vars=request.vars)}}';
var data = document.getElementById('drawcomment').toDataURL("image/png");
$.ajax({
url: url,
type: "GET",
data: {'data':data},
success: function (html) {
$('#results').html(html);
}
});
return false;
}
in controller:
def update():
return db().insert(data = request.vars.data)
Vào 04:32:53 UTC+7 Thứ bảy, ngày 12 tháng mười năm 2013, Ruud Schroen đã
viết:
>
> Hi,
>
> I am creating a app which uses html2canvas to create a screenshot of all
> content inside a specific div. It generates a canvas which acts as the
> screenshot. Now it is also possible to generate a image which you can
> download directly.
>
> This is the javascript code which will be used:
>
>
> 1. html2canvas(document.div, {
> 2. onrendered: function(canvas) {
> 3. /* Do something*/
> 4. }
> 5. });
>
>
> Is it possible to save this canvas as a image to a db record?
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.