-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathready.js
50 lines (41 loc) · 1.17 KB
/
ready.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var my_watermarked;
$(document).ready(function() {
// La magia aquí
$('<img>')
.attr('src', proceduralWatermark( 'DESDE', '99', ',99€'))
.appendTo( $('body') );
my_watermarked = new Watermark();
my_watermarked
.setPicture('img/source-image.jpg', [400, 250])
.addWatermark('img/wm-1.png',
{
position: [0,0]
}
)
.addWatermark('img/wm-2.png')
.addWatermark('img/wm-3.png',
{
position: [1,1],
scale: 2.0,
opacity: 0.5
}
)
.addWatermark(
proceduralWatermark( 'DESDE', '99', ',99€'),
{
position: [1,0]
}
)
.render( function(){
// var resulting_canvas = wm.getCanvases();
// $.each( resulting_canvas, function(idx, item) {
// $('body').append( $(item) );
// });
var resulting_imgs = my_watermarked.getImgs( 'image/png' );
$.each( resulting_imgs, function(idx, item) {
$('body').append( $(item) );
});
var resulting_data_urls = my_watermarked.getDataUrls( 'image/jpeg', 0.9 );
console.log(resulting_data_urls);
}); // render callback
});