Web Analytics Made Easy -
StatCounter image cropping through javascript - CodingForum


No announcement yet.

image cropping through javascript

  • Filter
  • Time
  • Show
Clear All
new posts

  • image cropping through javascript

    I need to do image cropping through javascript(without jquery)
    my requirement is just to get the coordinates through some callback function whenever user crop the image and click an ok button
    please help me with some javascript code here

  • #2

    This is not possible with vanilla JavaScript.

    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


    • #3
      The question is: Do you really need to "physically" crop the image or do you just want to show a cropped part of the image without actually cropping it?

      For the latter you can use a DIV with overflow:hidden and width/height of the visible cropped section and then position your image inside this DIV. I think the easiest way would be using a CSS background-image with background positioning.


      • #4
        use the canvas tag's api, you don't need a server anymore...
        Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com