Click here to Skip to main content
15,895,256 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,
I am working on image cropping facility.

I have a image box in which an image is coming.
What i want,
1- giving cropping facility.
2- image re-sizing facility or zoom in or zoom out facilty.

Something like facebook time line in which we can upload and then fit image on that box after drag up or down,

I am searching since long but haven't find anything related this.
If any of you have any idea or any suggestion how i could create this then please share with me.

Thanks
Posted

 
Share this answer
 
JavaScript
var $ = jQuery;
$(document).ready(function(){
         
var i = $("#name1").val();
 
   
$("#viewer").iviewer(
{
src: "sdf.jpeg", 
update_on_resize: false,
                       zoom_animation: false,
                       mousewheel: false,
                       onMouseMove: function(ev, coords) { },
                       onStartDrag: function(ev, coords) { return false; }, //this image will not be dragged
                       onDrag: function(ev, coords) { }
                  });
                   $("#in").click(function(){ iv1.iviewer('zoom_by', 1); }); 
                   $("#out").click(function(){ iv1.iviewer('zoom_by', -1); }); 
                   $("#fit").click(function(){ iv1.iviewer('fit'); }); 
                   $("#orig").click(function(){ iv1.iviewer('set_zoom', 100); }); 
                   $("#update").click(function(){ iv1.iviewer('update_container_info'); });
                       
 
                  var iviewer = {};
      var i = $("#name1").val();
                  $("#viewer2").iviewer(
                  {
       
                      src: 'pic/'+i,
                      initCallback: function()
                      {
                        iviewer = this;
                      }
                  });
 
                  $("#chimg").click(function()
                  {
                    iviewer.loadImage("test_image.jpg");
                    return false;
                  });
            });
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900