Solved

Image Scrolling

Posted on 1998-12-07
9
142 Views
Last Modified: 2010-05-18
I wanna do: When i click and drag in the JPEGImage, the scrollbars of the TScrollBox move to reflect mouse position.

mhieta
0
Comment
Question by:mhieta
  • 4
  • 3
  • 2
9 Comments
 
LVL 2

Author Comment

by:mhieta
Comment Utility
Edited text of question
0
 
LVL 10

Accepted Solution

by:
Lischke earned 10 total points
Comment Utility
Include an OnMouseDown event handler for the scrollbox to get the click positon. Then use this coordinates to set the position values of your scroll bars. You have eventually to offset the coordinates with the positon of the image within the scrollbox.

Ciao, Mike
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
hi mhieta,

now the question is answeres by other, here an example

var
  oldx, oldy : Integer;

procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if ssleft in shift then
  begin
    oldx := x;
    oldy := y;
  end;
end;

procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  if ssleft in shift then
  begin
    scrollbox1.horzscrollbar.position := scrollbox1.horzscrollbar.position - (oldx - x);
    scrollbox1.vertscrollbar.position := scrollbox1.vertscrollbar.position - (oldy - y);
    oldx := x;
    oldy := y;
  end;
end;

0
 
LVL 2

Author Comment

by:mhieta
Comment Utility
Thanks Lischke, but i need the code because i'm beginner.  Kretzschmars answer
is the answer what i need. So thanks both of you. How can i give points to you Kretzschmar?

mhieta
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
Hi mhieta,

there is now no way to give me the points after accepting Lischkes answer, except you or Lischke offers me a question to answer by me, but this decrease the point-account of yours.

Well, mhieta, Lischke, can we diskuss about the best way to give me the points?

Any other solutions?

meikl


0
 
LVL 2

Author Comment

by:mhieta
Comment Utility
Hi, Lischke, Kretzschmar,

Well this problem maybe needs some improvement to the valuation options. Ex. there is
3rd box where i can write who gets my points.

mhieta
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
Hi mhieta,

i don't think that this solution is applicable, because on some questions are even more experts than two.

Now i forget the points, and be happy, that i have helped you.

meikl
0
 
LVL 10

Expert Comment

by:Lischke
Comment Utility
Hi kretzschmar, mhieta,

I'm sorry about creating this little problem, but I thought the question is so easy, there's no need to discuss about it. Well, I was wrong. Next time I'll do better :-)

Sorry again and

Ciao, Mike

PS: kretzschmar, it was only a 10 point question, but if you like I'll post a dummy question for you to give you the points.
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
hi lischke,

points are not all of life,
i am here in  x-x just for fun and just for my brain and just for learning from other experts

so that the points doesn't matter for me

meikl


0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 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

13 Experts available now in Live!

Get 1:1 Help Now