Solved

How do you Locate Coordinates of Large Picture Behing Picture Box?

Posted on 2001-09-04
9
189 Views
Last Modified: 2008-03-06
I have a picture box with a extremely large picture behind it.  I use the (picMain.PaintPicture LoadPicture(Pic), x, y) to manuever around the large picture.  How do you determine the x,y coordinates of the large picture?

This is what I'm trying to do:  Inside the large picture box I have 10 small picture boxes that you can move around by clicking on one and then clicking on the location you want to move it to.  To do this I use the Left, Top Coordinates of the picture boxes.  Although, now, I have a large "map" (Much bigger than the large picture box) behind the large picture box that you can move around.  Although, using the left, top properties, when I move to a different position on the main map, the 10 small picture boxes(Units), stay at the same spot on the large picture box instead of staying at their locations on the "map" behind the large picture box.  When I move on the map I want the large picture box to remain in its same position.  The problem with using left, top properties is that when moving on the map it would be possible to move so far that you would not be able to see the small picture boxes any longer(But I'm not sure that with the left,top properties this would be possible).  So I would appreciate any help solving this problem.  Thanks.
0
Comment
Question by:minitrucker87
9 Comments
 
LVL 1

Expert Comment

by:NathanC
ID: 6455565
This will probably be of little help- but maybe give you some ideas-
set picmain.paintpicture.visible = false
set picmain.stretch = false before calling the load
then call the load
take the the height and width of picmain.paintpicture into vars-
create a conversion routine keeping original ratios but creating new dimensions of the picture that match your small boxes-
set picmain.height and width = to return of conversion-
set picmain.stretch = true
set picmain.visible = true

hope it helps...
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6455727
Do  you use vertical / horizontal scroll bars. If so, you could set the top/left properties of the other picture boxes, in the scroll bar click event(s), according to the large picture box's position.
0
 
LVL 1

Expert Comment

by:superchook
ID: 6455946
Also look at the picclip control. (in MS Common COntrols)
It's fast, and very flexible.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 43

Accepted Solution

by:
TimCottee earned 100 total points
ID: 6456887
minitrucker87: So if I understand correctly you want the small picture boxes to stay in the same position relative to the origin of the "Map" rather than the origin of the Picture box in which they are contained? If this is the case then it should be a relatively simple task as all you need to do is when you move the large picture box, determine the difference between the old origin relative to the map and the new origin relative to the map, add/subtract this from the origins of the smaller picture boxes as appropriate. The following code demonstrates an example of how this may be achieved.

Assumptions, large picture box is picLarge, small ones are control array picSmall(0) .. (9)

Private Sub MoveLarge(ByVal dX As Integer, ByVal dY As Integer)
  For intPicture = 0 To 9
    picSmall(intPicture).Left = picSmall(intPicture).Left - dX
    picSmall(intPicture).Top = picSmall(intPicture).Top - dY
  Next
  picLarge.Move picLarge.Left + dX, picLarge.Top + dY
End Sub

This will shift the position of the smaller picture boxes relative to the origin of the larger one as it is similarly moved relative to the origin of the "map". It may not directly apply to your scenario but the principle should be.
0
 
LVL 2

Expert Comment

by:JanusFury
ID: 6459055
Don't touch the picclip control.  Just follow tim's solution.
0
 
LVL 1

Expert Comment

by:superchook
ID: 6459173
I'm curious - what do you have against the picclip control ??

I've used it in several graphics intensive apps, and it provides a very useful set of tools at a high-level...

Not arguing, just wondering ?
0
 
LVL 1

Expert Comment

by:NathanC
ID: 6459313
As long as we are talking tools- LeadTools offers a very extensive set for pciture handling/manipulation.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7207629
Hi minitrucker87@devx,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TimCottee's comment(s) as an answer.

minitrucker87@devx, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7240958
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now