You sort of have the right idea but your numbers aren't quite right:

Using points as (x,y) with (0,0) being the top left corner of images:

Your clockface bitmap is 800x480 therefore the centre is at
(400,240)    (not (240,400) as you said)
Your clock hand bitmap is 60x140 with your stated centre of rotation
at (30,110)

If you place your clock hand bitmap at (400,240) in the clockface
bitmap the top left pixel (0,0) of your clock hand bitmap will be at
(400,240) which is not what you want as you figured out.

You need to translate along x &y to "move" the clock hand bitmap in to
the correct position. So to have (30,110) of your clock hand bitmap at
(400,240) in the clock face bitmap the clock face bitmap needs to
placed at the following location:

(400 -30, 240 - 110 )   = (370,130)

If you try and draw this on paper it will probably make more sense to
you.

Just a small bit of advice. I'm not sure doing these co-ordinates
explicitly is a good idea as not all phones have a screen resolution
of 800x480. Have a read of 
http://developer.android.com/guide/practices/screens_support.html



On Feb 3, 5:42 pm, BobG <[email protected]> wrote:
> I have a clock in the center of an 800x480 bitmap, and I have a 60x140
> clock hand/dial needle with center of rot at 30,110 in the bitmap. To
> place the center of rotation in the center of the bitmap, do I plave
> the needle bitmap using the top left coord offset 30,100 from the
> center, which is 240,400? Thanks so far. Im stumped.

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to