Solved

Picture with 'ready to click places'?

Posted on 2000-03-21
8
231 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
8 Comments
 
LVL 4

Expert Comment

by:jeurk
Comment Utility
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
Comment Utility
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
Comment Utility
Sorry, this comment is for another question.

Regards,
Kot.
0
 
LVL 4

Expert Comment

by:jeurk
Comment Utility
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Accepted Solution

by:
Rubbie earned 10 total points
Comment Utility
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
Comment Utility
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
Comment Utility
ok, thank u all!!!
 neoX:-)
0
 
LVL 4

Expert Comment

by:jeurk
Comment Utility
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

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

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…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

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

11 Experts available now in Live!

Get 1:1 Help Now