Hi,
I need to change the minHeight and minWidth of the component "ImageCropper".
The default is 50x50, i would 20x50.
how can I do ?
thanks in advance
bye
Fiorenzo
ImageCropper change minHeight and minWidth
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
- fiorenzino
- Posts: 32
- Joined: 26 Sep 2009, 12:00
Ok, waiting for future releases...
Some hacking like this?
But i don't want insert the name of component inside (xxxxx).
Or i need change /primefaces_resource/1.1/yui/imagecropper/imagecropper-min.js min dimension inside?
bye
fiorenzo
Some hacking like this?
Code: Select all
var ic = new YAHOO.widget.ImageCropper('xxxxxx');
var resize = ic.getResizeObject();
resize.set('minHeight', 100);
resize.set('maxHeight', 100);
resize.set('minWidth', 100);
resize.set('maxWidth', 100);
Or i need change /primefaces_resource/1.1/yui/imagecropper/imagecropper-min.js min dimension inside?
bye
fiorenzo
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
You can use widgetVar attribute of imageCropper to get a reference to the underlying YAHOO.widget.ImageCropper instance. So instead of var ic, it would be the widgetVar you've defined. I haven't tried this but checked the code so it should work.
- fiorenzino
- Posts: 32
- Joined: 26 Sep 2009, 12:00
Hi,
i tried:
also
but it don't works.
what is the correct syntax ?
thank's in advance..
Fiorenzo
i tried:
Code: Select all
<p:imageCropper id="cropper" value="#{imageCropperBean.croppedImage}" image="/images/img2ocr.jpg" widgetVar="crop"/>
<script type="text/javascript">
jQuery(crop.jqId).resize.set('minHeight', 10);
jQuery(crop.jqId).resize.set('minWidth', 10);
</script>
Code: Select all
<script type="text/javascript">
$(crop.jqId).resize.set('minHeight', 10);
$(crop.jqId).resize.set('minWidth', 10);
</script>
Code: Select all
Errore: crop is not defined
File sorgente: http://localhost:8080/gestionepersonale/index.jsf
Riga: 39
thank's in advance..
Fiorenzo
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
No jquery used in imagecropper currently, so try this;
More info;
http://developer.yahoo.com/yui/docs/YAH ... opper.html
Code: Select all
crop.set('minHeight', 100);
http://developer.yahoo.com/yui/docs/YAH ... opper.html
- fiorenzino
- Posts: 32
- Joined: 26 Sep 2009, 12:00
Hi,
don't works..
the final html code is:
the error is the same:
don't works..
the final html code is:
Code: Select all
<script type="text/javascript">
//<![CDATA[
YAHOO.util.Event.addListener(window, 'load', function() {
crop = new YAHOO.widget.ImageCropper('form:cropper_image',{initialXY:[99,326],initWidth:421,initHeight:65});
crop.on('moveEvent', PrimeFaces.widget.ImageCropperUtils.attachedCroppedArea, {hiddenFieldId:"form:cropper_coords"});
});
//]]>
</script><div id="form:cropper"><img id="form:cropper_image" src="/gestionepersonale/images/bolletta.jpg" /><input type="hidden" id="form:cropper_coords" name="form:cropper_coords" value="" /></div>
<script type="text/javascript">
//<![CDATA[
crop.set('minHeight', 100);
//]]>
</script>
Code: Select all
Errore: crop is not defined
File sorgente: http://localhost:8080/gestionepersonale/index.jsf
Riga: 39
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Your code should execute after document is ready.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
This is new imagecropper;
http://www.primefaces.org/labs/ui/imageCropper.jsf
It supports;
- initial crop area
- minSize
- maxSize
- backgroundColor
- backgroundOpacity
- aspectRatio
http://www.primefaces.org/labs/ui/imageCropper.jsf
It supports;
- initial crop area
- minSize
- maxSize
- backgroundColor
- backgroundOpacity
- aspectRatio
-
- Information
-
Who is online
Users browsing this forum: No registered users and 28 guests