ForgeKomponensek
hu

Komponensek

j-Crop

jComponent 20 · jcomponent@20 component Példa betöltve a jComponent 20-szal

Támogatás:

  • Zoom
  • Drag és Drop
  • Helyi fájlok
  • Válasz
  • automatikusan forgatja a képet az EXIF információk szerint

konfiguráció:

  • A céltávolság width {Number}, szükséges
  • height {Number} Cél magassága, szükséges
  • A dragdrop {Boolean} lehetővé teszi a drag&drop használatát (például: true)
  • background {String} háttérszín (elsődleges: átlátszó)
  • format {String} egy formátum az URL fájl generátor (default: {0})

Attribútumok

  • path="path-with-url-to-image" - URL-t kell tartalmaznia a képhez

módszerek:

// 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();

Használja a <ui-component name="crop">Amennyiben a készülék még nem tölthető le, jComponent letöltés az első felhasználásra a címről DEF.fallback (Azt a Componentator A szerző: Peter Širka. forrás: a Componentator Az összetevők raktár, MIT licenc.

example.html
<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>