Home | About us | Overview | Software - Download | Evaluate | Order | Support | Contact | F.A.Q. | Documentations | Blog | Newsletter
Loading...

Dynamically move objects

Support for GdImageBox OCX and GdImageBox Pro ActiveX/SDK.

Dynamically move objects

Postby kadalz » Sun Mar 01, 2009 12:57 pm

Hi,

I'm testing your ImageBox control for displaying a map. I placed some small picturebox for marking some area. My problem is, these picturebox are not moving to the correct location as the map is zoomed.

Also, what's the differences between imageBox and imageBoxCnt object?


Do you have any idea?

Regards,


Stanley
kadalz
 
Posts: 5
Joined: Sun Mar 01, 2009 12:42 pm

Re: Dynamically move objects

Postby kadalz » Sun Mar 01, 2009 1:18 pm

For example,

I have a coordinate (X,Y) of a picturebox object 500,700.

I placed the picturebox with this command:

Picture1.Left = (ImageBox1.GetImageLeft * Screen.TwipsPerPixelX) + 500
Picture1.Top = (ImageBox1.GetImageTop * Screen.TwipsPerPixelY) + 700

.. and resulting in incorrect placement as I zoom the Image.

I want the coordinate always follows the value of object.GetMouseX and object.GetMouseY but those are only used for the mice events.
kadalz
 
Posts: 5
Joined: Sun Mar 01, 2009 12:42 pm

Re: Dynamically move objects

Postby Loïc » Sun Mar 01, 2009 3:43 pm

Hi,

Try that:

Code: Select all
Dim ObjX As Long, ObjY As Long
 
Call ImageBox1.CoordImageToObject(500, 700, ObjX, ObjY)
Picture1.Left = ObjX * Screen.TwipsPerPixelX
Picture1.Top = ObjY * Screen.TwipsPerPixelY


Also, what's the differences between imageBox and imageBoxCnt object ?


ImageBoxCnt can work has object container, not ImageBox.

Best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4226
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Dynamically move objects

Postby kadalz » Sun Mar 01, 2009 5:06 pm

Hi Loïc,

Wow, that's works perfectly, thanks!

Case closed. :D


Stanley
kadalz
 
Posts: 5
Joined: Sun Mar 01, 2009 12:42 pm

Re: Dynamically move objects

Postby Loïc » Sun Mar 01, 2009 5:20 pm

Thank you for your Sunday feedback :D

Cheers,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4226
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdImageBox [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest