?
Solved

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

Posted on 2001-09-04
9
Medium Priority
?
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 43

Accepted Solution

by:
TimCottee earned 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 20 hours left to enroll

762 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