Click here to Skip to main content
15,905,874 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I will explain what i want to do and I am looking for suggestions/ideas for the best way to do it.
I am using ASP.NET/C#

I have an image and I want to highlight certain part of it depending on user input.

The best way I found, is to put another transparent layer on top of it containing predefined polygons for each region I want to highlight. This way I highlight the polygons depending on the input.

My question is what is the best way to create that layer on top of the image?

Also if anyone got other ideas please let me know.

Thanks a lot for any help
Posted

You can use any one of the widely available drawing libraries.

jsDraw2D[^] has some samples at that link and it's fairly easy to use.

If you need to support transparency, I think you need to venture into canvas. Check out gamejs[^] docs and samples here.

EDIT: My apologies...I thought that you were meaning to let the users DRAW polygons on first read. You can still use method #2 above and incorporate CSS to do the highlighting (on hover, for example).

The other approach would be to use PhotoShop (or a similar tool) that can do 'slices' with hover-over scripts. These usually work in all browsers and are relatively easy to do if you've got the source images. You'll create a 'highlight' layer that is revealed with a mouse over. Lots of tutorials out there so Google away!

Cheers.
 
Share this answer
 
v2
Thats exactly what this articles does with the captured image, take a look at the OnPaint implementation of the AdornerWindow.Cs file.

OneNote Style Screen Capture Utility - with Preview and Auto Save options[^]

Hope it helps.

Regards,
Vallarasu S.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900