Solved

Picture with 'ready to click places'?

Posted on 2000-03-21
8
243 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
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!

 
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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
delphi parse string to params 3 157
Breakpoint doesn't stop in my variable 3 38
Firemonkey Tcameracomponent resultion 1 26
Firemonkey Queue list 1 32
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 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