拼图 - 如何“着色”的图像从PHP的一部分? [英] Puzzle - How to 'colorify' part of an image from PHP?

查看:193
本文介绍了拼图 - 如何“着色”的图像从PHP的一部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一张地图(图片映射)在某些标准适用的区域显示为绿色,其他区域显示为黄色,其他区域显示为红色。

I want to have a map (which is image-mapped) show green in areas where some criteria applies, yellow in some other areas and red in other areas.

目标是显示可点击的图像,其将对匹配某些标准的某些状态着色。我以前考虑过闪光灯,但业主只是不想要闪光灯。一个可能的选择是在地图上显示可点击的彩色标签,但我也不知道如何做到这一点。有谁知道我可以如何解决这个?任何帮助将非常感激。谢谢!

The goal is to display a clickable image which will will colour certain states which match certain criteria. I was previously considering flash but the owner simply doesn't want flash. One possible alternative would be to display 'clickable' coloured labels on the map but I don't know how to do this either. Does anyone know how I can solve this? Any help will be much appreciated. Thanks!

推荐答案

这是我最后做的。


  • 我在维基百科上找到了尼日利亚的svg地图(它几乎每个国家都有
    的svg地图)。

  • I found an svg map of Nigeria on wikipedia (which has the svg maps of almost every country).

我下载了 InkScape ,并剪下了我不需要的部分

地图。

I downloaded InkScape and cut out the parts I didn't need from
the map.

我使用 Raphael SVG to HTML Converter tool 将其转换为可由raphael使用的
代码。

I used the Raphael SVG to HTML Converter tool to convert it to code usable by raphael.

非常容易,我可以使用path.fill'colorify'
的图像,它是很容易设置不同的功能,点击任何
部分。缩放也不是一个问题,因为图片可以基于容器动态缩放

From here it was quite very easy, I could use path.fill to 'colorify' the image and it was easy to set different functions for clicking any part. Scaling was also not an issue as the image could be scaled dynamically based on the container.

特别是 Olle 为我指出正确的方向!

Thanks to everyone especially Olle for pointing me in the right direction!

这篇关于拼图 - 如何“着色”的图像从PHP的一部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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