Click here to Skip to main content
15,918,268 members
Home / Discussions / C#
   

C#

 
GeneralRe: boo gat Pin
#realJSOP26-May-10 4:53
professional#realJSOP26-May-10 4:53 
AnswerRe: boo gat Pin
Pete O'Hanlon26-May-10 4:54
mvePete O'Hanlon26-May-10 4:54 
GeneralRe: boo gat Pin
Alaric_26-May-10 4:56
professionalAlaric_26-May-10 4:56 
AnswerRe: boo gat Pin
OriginalGriff26-May-10 4:57
mveOriginalGriff26-May-10 4:57 
GeneralRe: boo gat Pin
Alaric_26-May-10 4:58
professionalAlaric_26-May-10 4:58 
QuestionC# Image hot spots? Pin
Jacob Dixon26-May-10 4:08
Jacob Dixon26-May-10 4:08 
AnswerRe: C# Image hot spots? Pin
Henry Minute26-May-10 4:31
Henry Minute26-May-10 4:31 
AnswerRe: C# Image hot spots? Pin
Luc Pattyn26-May-10 4:32
sitebuilderLuc Pattyn26-May-10 4:32 
Here is a technique that often works well:
- have your image, shown to the user;
- have a second image (or a 2D array) of the same size, containing nothing but an item code for each pixel; so it could hold a value of 1 or RGB(1,0,0) for all pixels belonging to room 1, etc.; this "shadow" image is not shown to the user at all.
- have an array or list of items holding the description of each room.

While the mouse hovers the real image, use its (relative) position to do a GetPixel in the shadow image at the same location, that yields the room index (or a special value for none), then fetch the room description from the array/list. You can then:
- paint a highlighted outline of the room on top of the Control that shows the floor plan;
- stuff relevant information in the tooltip.

Remarks:
1. if your image is large, you might create a shadow image at a smaller scale, say 1/4.
2. filling the shadow image can be handled by code, based on the room description; it would then need coordinates of course.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

GeneralRe: C# Image hot spots? [modified] Pin
Jacob Dixon26-May-10 4:40
Jacob Dixon26-May-10 4:40 
GeneralRe: C# Image hot spots? Pin
Luc Pattyn26-May-10 4:47
sitebuilderLuc Pattyn26-May-10 4:47 
GeneralRe: C# Image hot spots? Pin
Jacob Dixon26-May-10 4:48
Jacob Dixon26-May-10 4:48 
GeneralRe: C# Image hot spots? Pin
OriginalGriff26-May-10 5:10
mveOriginalGriff26-May-10 5:10 
GeneralRe: C# Image hot spots? Pin
Luc Pattyn26-May-10 5:31
sitebuilderLuc Pattyn26-May-10 5:31 
GeneralRe: C# Image hot spots? Pin
OriginalGriff26-May-10 5:36
mveOriginalGriff26-May-10 5:36 
GeneralRe: C# Image hot spots? Pin
Luc Pattyn26-May-10 5:51
sitebuilderLuc Pattyn26-May-10 5:51 
GeneralRe: C# Image hot spots? Pin
Jacob Dixon26-May-10 8:29
Jacob Dixon26-May-10 8:29 
GeneralRe: C# Image hot spots? Pin
Jacob Dixon26-May-10 5:06
Jacob Dixon26-May-10 5:06 
GeneralRe: C# Image hot spots? Pin
Luc Pattyn26-May-10 5:27
sitebuilderLuc Pattyn26-May-10 5:27 
GeneralRe: C# Image hot spots? Pin
Jacob Dixon26-May-10 6:21
Jacob Dixon26-May-10 6:21 
GeneralRe: C# Image hot spots? Pin
Luc Pattyn26-May-10 6:42
sitebuilderLuc Pattyn26-May-10 6:42 
GeneralRe: C# Image hot spots? Pin
Jacob Dixon26-May-10 6:52
Jacob Dixon26-May-10 6:52 
GeneralRe: C# Image hot spots? Pin
Luc Pattyn26-May-10 7:39
sitebuilderLuc Pattyn26-May-10 7:39 
GeneralRe: C# Image hot spots? Pin
DaveyM6926-May-10 7:49
professionalDaveyM6926-May-10 7:49 
GeneralRe: C# Image hot spots? [modified] Pin
Luc Pattyn26-May-10 7:58
sitebuilderLuc Pattyn26-May-10 7:58 
GeneralRe: C# Image hot spots? Pin
DaveyM6926-May-10 13:07
professionalDaveyM6926-May-10 13:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.