CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: [RESOLVED] Retrieving the size of a rotated image

  1. #1
    Join Date
    May 2008
    Posts
    8

    [RESOLVED] Retrieving the size of a rotated image

    I'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:
    ?=rotate
    get variable I pass to it. Problem is that because the image is square, imagerotate (the function I'm using) makes the overall canvas bigger and bigger, to it's maximum size, at any of the 45 degree angles. This is not what I expected, nor what I want, what I'd much prefer is it to stay exactly in it's place and clipping to occur. I understand how I could do this manually, but to do so, I'd need the dimensions of the newly rotated image, in it's current form, rather than how it was. The only function I can see that does something like that,
    Code:
    getimagesize()
    only works for images loaded directly from a file, rather than a resource (which is what imagerotate returns). Is there another function that gives you the same as what getimagesize() does, but for a manipulated resource?

    Thanks guys.

  2. #2
    Join Date
    May 2008
    Posts
    8

    Re: Retrieving the size of a rotated image

    for anyone interested, it's the functions imagesx and imagesy that give you the width and height of a resource image.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)