在图像顶部创建一个包含多边形的图层. [英] Creating a layer containing polygons on top of an image.

查看:72
本文介绍了在图像顶部创建一个包含多边形的图层.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将解释我想做的事情,我正在寻找建议/想法,以实现最佳方法.
我正在使用ASP.NET/C#

我有一张图片,我想根据用户输入突出显示其中的某些部分.

我发现的最佳方法是在其上面放置另一个透明层,其中包含要突出显示的每个区域的预定义多边形.通过这种方式,我可以根据输入内容突出显示多边形.

我的问题是在图像顶部创建该图层的最佳方法是什么?

另外,如果有人有其他想法,请告诉我.

非常感谢您的帮助

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

推荐答案

您可以使用任何一种广泛使用的图形库.

jsDraw2D [ ^ ]在该链接上有一些示例,并且相当容易使用.

如果您需要提高透明度,我认为您需要尝试一下.查看 gamejs [
干杯.
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.

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.


这正是本文对捕获的图像所做的,请看一下AdornerWindow.Cs文件的OnPaint实现.
OneNote样式屏幕捕获实用程序-带有预览和自动保存选项 [
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.


这篇关于在图像顶部创建一个包含多边形的图层.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆