Centering an image

Q&A about the latest versions
Post Reply
Colbern
Posts: 2
Joined: Sun Apr 25, 2010 3:19 am

I have used the skin editor to make an image appear when a hotspot icon is clicked. At the moment, I have to guess/ calculate the center of the panorama to place the image (that's where I want this image to appear) by altering the x,y coordinates of the imported image. Is there any way to have this image center itself so that It always appears in the exact centre of the panorama, regardless of its size and how big the window is? Thanks!
jeroen
Posts: 78
Joined: Tue Jan 06, 2009 4:36 pm

To center an image you can calculate the coordinates

eq. image size is 32 at 16 pixels X to the left (being -16) and half the Y abve the center (being -8)

To add an image make sure you select the ancor and the center both on the center.

If you want to calculate the values so you can enter the values into the Postion of the element

Image size is imageWith at ImageHeight (eq 32 at 16 pixels) the Skin Editor Size is WindowWith at WindowHeight (default 640 at 480)

The X postion of the image will be (WindowWith / 2) - (imageWith /2 )
The Y postion of the image will be (WindowHeight / 2) - (ImageHeight / 2)

Example:
Image has size of 32 x 16 pixels
The editor has a window size of : 640 x 480 pixels

X = (640 / 2) - (32 / 2) = (320) - (16) = 304
Y = (480 / 2) - (16 /2) = (240) - (8) = 232

If it ain't clear I will post some pictures.
Jeroen / Amersfoort / The Netherlands
Post Reply