Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Picture with 'ready to click places'?

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
neox
Asked:
neox
1 Solution
 
jeurkCommented:
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
 
kotikCommented:
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
 
kotikCommented:
Sorry, this comment is for another question.

Regards,
Kot.
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.

 
jeurkCommented:
0
 
RubbieCommented:
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
 
jeurkCommented:
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
 
neoxAuthor Commented:
ok, thank u all!!!
 neoX:-)
0
 
jeurkCommented:
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

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now