ForgeKomponenty
cs

Komponenty

j-Crop

jComponent 20 · jcomponent@20 component Příklad načten s jComponent 20

Podpora:

  • Zoom
  • Přejít a drop
  • Lokální soubory
  • Odpovědnost
  • automaticky otáčí obrázek podle informací EXIF

Konfigurace:

  • width {Number} Cílová šířka, požadovaná
  • height {Number} Cílová výška, požadovaná
  • dragdrop {Boolean} umožňuje přepínání a odkládání (předvolené: true)
  • background {String} barva pozadí (podle předvolby: transparentní)
  • format {String} formát pro generátor souborů URL (předvolený: {0})

Atributy

  • path="path-with-url-to-image" - musí obsahovat URL obrázku

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

Použijte ji s <ui-component name="crop">Pokud je součástka ještě nezačleněna, jComponent Stáhnout ji na první použití z adresy DEF.fallback a) The Componentator CDN dle předvolby. autor: Peter Širka. zdroj: Componentator Výrobce je autorizován, MIT licence.

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>