![]() |
cropping images ( this style ) [REQUEST]
how do I do this:
http://garrysmod.com/challenge/image...30&w=125&h=250 I made a crop image which centers itself from the corridinates by cropped images, and dividing by 2 but.. how do I achieve this effect, by the way, go ahead and increase the w and h url vars to see more. |
[bump] 12346 vvvv
|
I did a quick thumbnail function here to show you how simple it really is, it might not be working as im pretty tired and I was about to go to bed ;)
PHP Code:
|
Quote:
|
Hmm I fixed the code, but I see it wasn't what you wanted in first place, but thats what you get out of being up late >.<
|
Quote:
|
PHP: imagecopyresized - Manual
Will do what you want, look specifically at SRC_X and SRC_Y -- you can tell it what coordinates you want to start the copy at, effectively creating a cropped area. -m |
Quote:
:P |
Okay, but it can still do it, and in this case if all you want to do is create a cropped area you don't need to use resampled, because you're not resizing. You're just chopping some off.
-m edit: I just looked closer at your example. It's not cropping like I originally thought, it's just resizing. So that should be easy? Let me try something here... |
Okay, so theirs isn't just resizing, it's cropping too, based on what size you enter... so this is pretty close, all mine does is resize it, but I just woke up. I think they're probably using some kind of math to figure out a crop area based on the ratio of the size entered. I didn't tinker with that at all. Also i'm not sure if you can dynamically display the new image without saving it as an actual physical file somewhere. If you can, I'd love to know how, if anybody knows?
PHP Code:
|
Quote:
|
If you know the person, tell him to cough up the code so you can dissect it and learn!
-m |
Quote:
He has his own forums: Facepunch Studios (Forums) though I warn you, theres idiots about xD |
[quote=delayedinsanity;14731]PHP: imagecopyresized - Manual
Will do what you want, look specifically at SRC_X and SRC_Y -- you can tell it what coordinates you want to start the copy at, effectively creating a cropped area. -m[/QUoute] ************************************************** ******** One quick question. I'm trying to do the same thing. I'd like to start my cropping from a particular area/coordinates. Below is the sample code. Also, if you follow the link to the original gif and then in your favorite editor crop the image so that its at the following dimension 438x519 from the center. I took the following pixels (left 0, Right 119, Top 476, Bottom 204). This above result is what I'm trying to get the following code to produce. Any assistance again you may provide would truly be appreciated. Thank you, j4v1 PHP Code:
|
| All times are GMT. The time now is 10:12 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0