Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8830705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:09:21+00:00 2026-06-14T08:09:21+00:00

Now I am building a website for image manipulation and I am using most

  • 0

Now I am building a website for image manipulation and I am using most the functions in Pixastic and they are really good. However, I was thinking whether there is any improvement for the cropping function.

I can use the cropping function in Pixastic but I would like to crop image through cursor.
I don’t want to put in the values of the position like this:

function cropImg()  {
Pixastic.process(document.getElementById("image"), "crop", {rect: {left: 50, top:50, width:50, height: 50}});

};

However, I couldn’t figure out how to get the value of the position by using jquery, such as offset(), e.pageX, e.pageY, mousedown() and mouseup(), so I decide to use Jcrop for cropping. But if anyone of you can help me figure this out will be very nice.

This is my Jcrop code:

$(document).ready(function(){
$('#image').Jcrop({
    onChange: showCoords,
    onSelect: showCoords
});
});
function showCoords(c)
{
$('#x').val(c.x);
$('#y').val(c.y);
$('#x2').val(c.x2);
$('#y2').val(c.y2);
$('#w').val(c.w);
$('#h').val(c.h);
}; 

These Jcrop code enable me select the area and tell me the value of the position but It didn’t show me how to crop or the button that I can set up for the function, so I was thinking whether I can combine Pixastic and Jcrop like this:

function cropImg()  {
Pixastic.process(document.getElementById("image"), "crop", {rect: {left: $('#x').val(), top: $('#y').val(), width: $('#w').val(), height: $('#h').val()}});

};

I was thinking that if Jcrop can tell me the value of the positions, I can just put those values into the Pixastic cropImg function.

I put Pixastic code and Jcrop code separately in two files, but no matter what I do, they can’t work together. Either I can select the image and none of the Pixastic functions work or Jcrop doesn’t work.

Thus, I am asking for help if anyone knows how to make the cropping work and I appreciate your answers very much!! Please let me know if I haven’t explained my question clearly and more information you need to solve this.

Thank you in advance and sorry for such long question.
Have a great day!!

P.S I just learned HTML, CSS and Javascript a month ago but don’t know other programming languages at all, so if you can explain in details or give me an easier answer, that will be great!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:09:22+00:00Added an answer on June 14, 2026 at 8:09 am

    Here is the code that I used now in my project.

    var canvasImage = $(".editor canvas");
    canvasImage.Jcrop({
        onSelect: function (coords) {
            canvasImage.pixastic("crop", {
                rect: {
                    left: coords.x,
                    top: coords.y,
                    width: coords.w,
                    height: coords.h
                }
            });
            this.release();
            this.disable();
        }
    });
    

    Note that I used also Pixastic jQuery adapter in addition to Jcrop & Pixastic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a multi-lingual website using drupal 7. Now, I'm in the process of
I'm new to website building, so I'm really struggling! I have an image of
I am currently building a basic website. So far so good, however it's getting
I am building a website using PHP and a mySQL database. The website now
So I was learning JavaScript/jQuery and building a website as I go along. Now
i am building a php based website but now i need to give user
The application I'm building right now has problems when using HTTP post. When timeout
I'm building a website based on RoR, and using a third-party gem devise. I
Good Evening, I'm building a website which will will look something like this: So
I am using asp.net with sql server 2008 r2 I am building a website

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.