|
|
| New Topic Reply Subscription Options |
|
| Forums: ImageCFC Forum: Cropping centre | |||
|
|||
| JanSolo
Joined: 07/03/07 Posts: 8 |
Cropping centre Posted Tuesday, July 3, 2007 at {ts '2013-05-20 11:13:00'} Hi Rick, First of all - great cfc - love it. Took me ages to find this type of thing. I am trying a crop method and was wondering if it is possible to crop in the center/middle of a larger image instead of from the specific pixel measurement from the top left. Regards Jan |
||
|
|||
| admin
Location: Apex, NC Posts: 193 |
RE: Cropping centre Posted Tuesday, July 3, 2007 at {ts '2013-05-20 11:22:00'} There is no specific method needed to do this, you just have to calculate the math up front. For example... use the readImage() method to return an image object, then the getImageInfo() method to get its dimensions. startx = int((originalWidth - desiredWidth) / 2); THEN call the crop image with those dimensions and pass in the image object instead of the file path. Although it takes a few more lines of code, it shouldn't perform any slower since there's still only one file read and and one file write.. the rest of the stuff happens on the image object in memory Rick Rick Root
|
||
|
|||
| JanSolo
Joined: 07/03/07 Posts: 8 |
RE: Cropping centre Posted Wednesday, July 25, 2007 at {ts '2013-05-20 06:47:00'} sorry I didn't reply, but that is great - works well, I just had to remember to set the size before crop to be two pixels bigger cos then you get the exact centre! |
||
|
|||
| New Topic Reply Subscription Options |
|
| Subscription Options |
| Subscription options are available after you log in. |
There are 20 active user sessions right now.