![]() |
|
#1
|
|||
|
|||
Retrieving the size of a rotated imageI'm using GD2 with PHP 5.2.9.2 and I'm trying to create a dynamic compass type thing. What I'd like is simply an arrow image that will change where it's pointing based on the
Code:
Code:
Thanks guys. |
|||
|
#2
|
|||
|
|||
Re: Retrieving the size of a rotated imagefor anyone interested, it's the functions imagesx and imagesy that give you the width and height of a resource image.
|
|
#3
|
||||
|
||||
Re: Retrieving the size of a rotated imageWhy don't you just compute the new size? If the original image is w x w, and you rotate by an angle theta, the new size will be w*(sin(theta) + cos(theta)). I've attached an image that shoes why this formula works. It may be off by a pixel due to rounding error, but is should give you a good enough estimate.
__________________
www.blake-foster.com |
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Image onto JFrame | tedds | Java Forum | 8 | 25-Oct-2007 20:04 |
| Need Help With Recursive Functions | jonas12rena | C Programming Language | 1 | 31-Jul-2006 11:12 |
| GIM gidedit - a fltk fluid resize project | cable_guy_67 | FLTK Forum | 2 | 01-Jun-2005 15:00 |
| Checking source codes of image, audio and video files | onauc | C Programming Language | 5 | 26-Feb-2005 21:47 |
| Having a problem | Chuckles | Computer Hardware Forum | 19 | 13-Sep-2004 12:17 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The