在 Flex、as3 中围绕任何形状(心形、圆形等)绘制图形边框
好吧,从过去的几个月来看,我正在寻找一个解决方案,但找不到这个问题的确切答案
问题是:
假设我有这张图片(如下所示),并且我必须在该图片周围显示内部边框图像,我认为通过图形显示周围的边框是最好的,
但是图形有一些有限数量的函数,如drawRect,drawRoundedRect等,
我也从Senously.com看到了Path.as,
我想知道的是它可以围绕这个形状绘制内部边框或任何其他不规则形状(通过图形,我猜我需要找到图像周围的边框像素),
我不想使用任何虚线(此图像上的另一个图像)作为边框,我知道这是一个解决方案,:-),但是这次事情非常基于计算,所以你们中的任何一个人都有任何工作算法或任何类似的东西,可以让我在任何形状周围绘制虚线边框,这会很有帮助,
我是Flex 开发人员,所以我应该告诉你这张图片是在某些画布中,我正在将此图像的位图数据绘制到画布中
谢谢
Well from last few months, i am looking for one solution, but couldn't find the exact answer to this question
The problem is :
Suppose i have this image with me(shown below), and i have to show a inner border around this image and i think showing border around this would be best through graphics,
but graphics has some limited number of functions like drawRect, drawRoundedRect etc,
I also have seen Path.as from Senocular.com,
The thing which i want to know, is it possible to draw a inner border around this shape or any other irregular shape(through graphics, i need to find the border pixels around the image, i guess),
i don't want to use any dotted line(another image over this image) as a border, i know thats a solution, :-), but this time things are pretty based on calculation, so any one of you have any working algorithm or any things like that which could let me draw dotted border around any sort of shape, that would be much helpful,
I am flex developer, so i should tell you this image is in some canvas, i am drawing the bitmap data of this image in to the canvas
Thank You
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的符号非常基本(未屏蔽),您可以使用简单的 getBounds 或 getBoundsRect 属性。如果它们更复杂,您可能会发现这很有用:
照顾:http://usecake.com/lab/find-the-height-and-width-of-a-sprite-with-a-scrollrect.html
You could use the simple getBounds or getBoundsRect properties if your symbols are pretty basic (not masked). If they're more complex, you might find this useful:
Care of: http://usecake.com/lab/find-the-height-and-width-of-a-sprite-with-a-scrollrect.html