Solved

Picture with 'ready to click places'?

Posted on 2000-03-21
8
248 Views
Last Modified: 2010-04-04
I have a picture in TImage and I want to make on him some places where 'onmouseover' change the cursor and when I click on it, it will open another picture in TIMAGE.
I know I can do it as more TIMAGEs and on every I want I can write onmouseover proc. Is there another way?
0
Comment
Question by:neox
[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
8 Comments
 
LVL 4

Expert Comment

by:jeurk
ID: 2641277
If you want that I can send it to you :
==============================
 Component THotImage ver 2.12
==============================

Allows creating 'Hot Spots' on target image

THotImage derived directly from TImage,
thus have all features of ascentor+ additional events/properties.
There is also visual property editor for editing HotSpots property.
Mask Actions added. When mouse goes over or down at hot area
"spot" part of image can be replaced by part of MaskPicture


Delphi's version supported: D2,D3,D4
0
 
LVL 2

Expert Comment

by:kotik
ID: 2641280
It's only a suggestion, try this:

var
  Position: integer;
begin
  SendMessage(RichEdit.Handle, EM_POSFROMCHAR, Position, 0
);
end;

Regarding to the Win32 Help:
A returned coordinate can be negative if the character has been scrolled outside the edit control's client area.

So you can get abs(Position) to get the real offset.

Regards,
Kot.

0
 
LVL 2

Expert Comment

by:kotik
ID: 2641284
Sorry, this comment is for another question.

Regards,
Kot.
0
Independent Software Vendors: 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!

 
LVL 4

Expert Comment

by:jeurk
ID: 2641303
0
 

Accepted Solution

by:
Rubbie earned 10 total points
ID: 2642074
You can annalyze the position of the mouse cursor in the OnMouseMove event, and change the cursor accordingly.
For example, if you have a hotspot at position top:50, left:50 in your image and the hotspot is a square 10x10 you can write in the procedure for the OnMouseMove event:

if (X > 50) and (X < 60) and (Y > 50)   and (Y < 60) then Image1.Cursor:=crHandPoint
else Image1.Cursor:=crDefault;

You can have whatever you want cursor at different hotspots. Then, on the OnMouseDown event write the code you want, checking the coordinates where the user clicked.
0
 
LVL 4

Expert Comment

by:jeurk
ID: 2643921
Hi,
This is what the component is doing for you.
Sometimes you may have very complex regions.
This will be a real pain to handle.
0
 

Author Comment

by:neox
ID: 2644634
ok, thank u all!!!
 neoX:-)
0
 
LVL 4

Expert Comment

by:jeurk
ID: 2729894
hello neox,
Maybe you coul accept or reject the question.
What did you used to solve your problem.
this you used my component or did you do like rubie says ?
a thank U is great, but we also want the points...
Thanks.
0

Featured Post

Independent Software Vendors: 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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month11 days, 7 hours left to enroll

623 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