j-Crop
Wsparcie:
- Zoom
- Drak i Drop
- Lokalne pliki
- Odpowiedź
- automatycznie obrazy według informacji EXIF
Konfiguracja:
width {Number}szerokość docelowa, wymaganeheight {Number}Wysokość docelowa, wymaganedragdrop {Boolean}umożliwia drganie i odprowadzanie (default:true)background {String}kolor tła (default: przejrzysty)format {String}format dla generatora plików URL (default:{0})
atrybuty
path="path-with-url-to-image"- musi zawierać URL do obrazu
Metody:
// e.g.
var component = FIND('croper');
// Resize canvas
component.reconfigure('width:500;height:200');
// Get cropped image
// component.output([type], [return_object])
var png = component.output('image/png');
var jpg = component.output('image/jpeg');
// Below method automatically detects the transparency and sets the output
var data = component.output();
// var data = component.output(true);
// data.filename {String}
// data.data {String} base64
// New method for clearing of canvas
component.clear();Użyj go z <ui-component name="crop">Gdy element nie jest jeszcze ładowany, jComponent Pobierz go po pierwszym użyciu z adresu DEF.fallback (Wydaje się Componentator Autor: Peter Širka Źródło: Componentator Zestaw składników, licencja MIT.
<div style="width:500px">
<ui-component name="crop" path="model.picture" config="width:200;height:200"></ui-component>
</div>
<script>
var model = {};
model.picture = 'https://avatars0.githubusercontent.com/u/2414252?v=3&s=460';
</script>