andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


CropMinSize on each CropSizeList?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas
View previous topic :: View next topic  
Author Message
dibya
Newbie


Joined: 04 Jul 2006
Posts: 2

PostPosted: Tue Jul 04, 2006 5:59 am    Post subject: CropMinSize on each CropSizeList? Reply with quote

hi everybody..
is there a way to make each of the CropSizeList have MinimumSize, so there are several CropMinSize on each of the CropSizeList..
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Tue Jul 04, 2006 7:23 am    Post subject: Reply with quote

Just to clarify what you want to do for anyone else reading this:

The requirement is to have the minimum width and height be set to the same dimensions as set by the drop-down list, giving the user the ability to scale up but never below the set size.

This can be done with a quick tweak in the cc_setCropDimensions javascript function as found in the inc.cropinterface.php file. By default the function looks like:

Code:
function cc_setCropDimensions(w, h)
{
    dd.elements.theCrop.moveTo(dd.elements.theImage.x, dd.elements.theImage.y);
    dd.elements.theCrop.resizeTo(w, h);
    dd.elements.theCrop.defw = w;
    dd.elements.theCrop.defh = h;
    cc_reposBackground();
}


You want to update it to look something like the following:

Code:
function cc_setCropDimensions(w, h)
{
    dd.elements.theCrop.moveTo(dd.elements.theImage.x, dd.elements.theImage.y);
    dd.elements.theCrop.resizeTo(w, h);
    dd.elements.theCrop.defw = w;
    dd.elements.theCrop.defh = h;
    dd.elements.theCrop.minw = w;
    dd.elements.theCrop.minh = h;
    cc_reposBackground();
}


You may choose to wrap this up in a PHP if conditional so that you can turn on or off that feature, but essentially the two extra lines should be all you need to make it work.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
dibya
Newbie


Joined: 04 Jul 2006
Posts: 2

PostPosted: Tue Jul 04, 2006 7:59 am    Post subject: Reply with quote

wow...
fast response, simple tweak.. and WORKS!

tq..
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group