# j-Crop

> j-Crop: Zoom e Drop

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: it
Content-SHA256: 72760aef6f18c09e90f4d86b478a9aa06ac38ebc56f73612bcd38d3bc1ec5cbd
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

__Supporto__:

- Il zoom
- Drag e Drop
- I file locali
- Rispondi
- Rotazione automatica dell'immagine secondo le informazioni EXIF

__Configurazione__:

- L'obiettivo è quello di `width {Number}`, richiesto
- `height {Number}` Altezza di destinazione, richiesto
- `dragdrop {Boolean}` consente di spostare e scendere (default: `true`)
- `background {String}` un colore di sfondo (default: trasparente)
- `format {String}` un formato per il generatore di file URL (default: `{0}`)

__Attributi__
- `path="path-with-url-to-image"` - deve contenere URL per la foto

__Metodi__:

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

Utilizzare con `<ui-component name="crop">`Quando il componente non è ancora caricato, jComponent Scarica il codice in prima utilizzazione dall'indirizzo `DEF.fallback` (Il Componentator La storia di Peter Širka.Fonte: il Componentator Ristorante dei componenti, licenza MIT.

```html 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>
```
