realbasic-games
[Top] [All Lists]

Re: Drawing Rotated Image

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Drawing Rotated Image
From: Phil M <phil at mobleybros dot com>
Date: Wed, 21 Sep 2005 20:48:16 -0700
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <496bf51a05092019337180466a at mail dot gmail dot com> <a06200704bf567b8c2eb0 at 10 dot 0 dot 1 dot 4> <496bf51a0509211826355b31bb at mail dot gmail dot com>
On Sep 21, 2005, at 6:26 PM, Andrew Krebs wrote:

Sure thing.  The size of the picture is smaller than the canvas, I am
sure of that.  I'm testing this on Windows XP with 5.5.5.

  Dim px As PixmapShape
  Dim pic As Picture
  const pi = 3.14159

  pic = xmediumred

  px = New PixmapShape(pic)
  px.rotation = 45 * (pi/180)

  Canvas1.Graphics.DrawRect 0,0,Canvas1.Width,Canvas1.Height
  Canvas1.Graphics.DrawObject px,0,0
  Canvas1.Graphics.DrawObject px,150,150

And to illustrate my point, a picture!
http://www.filefarmer.com/dimmensionx/forjoe.gif

I believe you are assuming the X and Y to be based on the upper left coordinate; but a PixmapShape X and Y is based on the absolute center of the shape.

So it is really not the rotation that is causing this issue (disable it and see) but the placement when you write:

  Canvas1.Graphics.DrawObject px,0,0

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>