Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Movement of image

Status
Not open for further replies.

DavidAWH

Programmer
Nov 4, 2001
16
0
0
AU
Hi Guys
I am working on a GPS app and am trying to get an image to move in a picture box depending on co-ordinates returned from the GPS.

I can work out the code to find the correct image to load and where the current position is on the image based on the image size and co-ordinates of the centre and four corners of the image.

Displaying the image so that it keeps the current position in the centre of the picture box is where I come up against a brick wall

If anyone can guide me in the right direction it would be much appreciated

Thanks
 
I always use a trick for this kind of problem. Create a picturebox (A) and inside that picturebox create another one (B). Now picbox B contains the entire image and it's sizemode is autosize. Now you can easily move picbox B around in picbox A (you can use negative location values), making it look like you are moving the image. It will still take some calculations, but at least you have total freedom of where to make the image appear.

Regards, Ruffnekk
---
Is it true that cannibals don't eat clowns because they taste funny?
 
Thanks Ruffnekk

Did not seem to be able to put a pic box inside a pick box but managed the same with a pic box inside a panel - the nagative locations was the trick that I needed.

Another Quick question. I want to be able to put another picture in the centre of the image inside the panel, like a cross or a little car, to indicate the position. Is it possible to use an image of a cross, with a transparent background, so the undelying image shows through
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top