forked from 0x2620/oxjs
update image module
This commit is contained in:
parent
be9928d105
commit
d3b1e89eec
2 changed files with 186 additions and 18 deletions
|
|
@ -1,11 +1,29 @@
|
|||
Ox.load('Image', function() {
|
||||
|
||||
Ox.Image('png/Netherlandish Proverbs.png', function(image) {
|
||||
Ox.element('<img>').attr({src: image.url()}).appendTo(Ox.element('body'));
|
||||
image.saturation(-0.9);
|
||||
Ox.element('<img>').attr({src: image.url()}).appendTo(Ox.element('body'));
|
||||
image.brightness(-0.5);
|
||||
Ox.element('<img>').attr({src: image.url()}).appendTo(Ox.element('body'));
|
||||
// see http://en.wikipedia.org/wiki/Lenna
|
||||
|
||||
Ox.Image('png/Lenna.png', function(image) {
|
||||
var body = Ox.element('body'),
|
||||
select = Ox.element('<select>').appendTo(body);
|
||||
['Filter...', 'blur', 'channel', 'contour', 'invert', 'edges', 'emboss', 'motionBlur', 'posterize', 'sharpen', 'solarize'].forEach(function(filter) {
|
||||
Ox.element('<option>').html(filter).appendTo(select);
|
||||
});
|
||||
select[0].onchange = function() {
|
||||
if (select[0].value[0] == select[0].value[0].toLowerCase()) {
|
||||
Ox.element('#filter').attr({
|
||||
src: image[select[0].value]().url()
|
||||
});
|
||||
}
|
||||
}
|
||||
Ox.element('<br>').appendTo(body);
|
||||
Ox.element('<img>').attr({
|
||||
src: image.url()
|
||||
}).appendTo(body);
|
||||
Ox.element('<img>').attr({
|
||||
id: 'filter',
|
||||
src: image.url()
|
||||
}).appendTo(body);
|
||||
//Ox.element('<img>').attr({src: image.saturation(0.5).blur().url()}).appendTo(Ox.element('body'));
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue