Solved

Image Scrolling

Posted on 1998-12-07
9
144 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
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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 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

21 Experts available now in Live!

Get 1:1 Help Now