Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Image Scrolling

Posted on 1998-12-07
9
Medium Priority
?
154 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
[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
  • 4
  • 3
  • 2
9 Comments
 
LVL 2

Author Comment

by:mhieta
ID: 1349624
Edited text of question
0
 
LVL 10

Accepted Solution

by:
Lischke earned 10 total points
ID: 1349625
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
ID: 1349626
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 2

Author Comment

by:mhieta
ID: 1349627
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
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1349628
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
ID: 1349629
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
ID: 1349630
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
ID: 1349631
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
ID: 1349632
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

715 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