function BlobListener(type, canvas, callback, file)
{
is(file.type, type, "When a valid type is specified that should be returned"); var reader = new FileReader();
reader.onload =
function(e) {
is(e.target.result, canvas.toDataURL(type), ");
callback(canvas);
};
reader.readAsDataURL(file);
}
function test1(canvas)
{ canvas.toBlob(BlobListener.bind(undefined, "image/png", canvas, test2));
}
function test2(canvas)
{ canvas.toBlob(
BlobListener.bind(undefined, "image/jpeg", canvas, SimpleTest.finish), "image/jpeg");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.