Image coordinate system

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
r_houdek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 12
Joined: Wed Feb 23, 2011 1:35 am

Image coordinate system

Post by r_houdek » Tue Feb 28, 2012 4:44 am

I'm wondering if someone can help explain this issue I'm having:

1. Create an image and draw a series of rectangles
- create image
- choose rect tool
- drag from 100,100 to 150,120
- etc...

2. Create a field and give it the same dimensions as the rectangle above
- set the rect of field "f1" to 100,100,150,120
- etc...

I'm finding that I don't get a perfect overlap between the rectangles and fields. Some are off by 1 or 2 pixels, some on the right, some on the bottom - but it's not consistent.

I'm building an app where I want to overlay fields on the image but I'm not getting perfect alignment. I've attached a small screenshot. Any ideas?

Thanks in advance!

Ritch
Attachments
rectangle.JPG
rectangle.JPG (8.78 KiB) Viewed 3451 times

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Image coordinate system

Post by Dixie » Tue Feb 28, 2012 12:07 pm

Ritch...

Off the top of my head, have a look at the 'margins' settings of the rectangles and the fields... perhaps try setting them to either the same value or to zero to help with the alignment...

or... if the graphics and the fields are the same dimensions then something like

Code: Select all

set the loc of fld 1 to the loc of grc 1
should help...

be well

Dixie

Post Reply

Return to “Multimedia”