as3 从位图中复制自定义形状
所以, 我有 bitmapA ,它是矩形的。我有一个想要复制的裁剪区域...
但是,位图与裁剪区域成一定角度。
如何从位图中复制不是位于 x、y、轴上的矩形的部分?
或者复制自定义形状???
谢谢
So,
I have bitmapA which is rectangular. I have a crop area I want to copy...
However, the bitmap is at an angle from the crop.
How do I copy a section from a bitmap that isn't a rectangle laid outon the x, y, axis??
Or copy custom shape????
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果需要旋转裁剪矩形,可以使用
draw
方法按照 shortstick 建议裁剪红色区域,如下所示:替代文本 http://axly.org/_tmp/stackoverflow/crop_sample.png
结果如下:
替代文本 http://axly.org/_tmp/stackoverflow/crop_result.png
希望这就是您正在寻找的内容,否则请提供更多详细信息,甚至更好地提供视觉样本。
If you need to crop a rectangle with rotation, you can use
draw
method as suggested by shortstick to crop the red area as shown below:alt text http://axly.org/_tmp/stackoverflow/crop_sample.png
The result is below:
alt text http://axly.org/_tmp/stackoverflow/crop_result.png
Hope that is what you were looking for, otherwise please give more details and, even better, a visual sample.
我能想到的最简单的方法是获取一个临时位图并使用
draw
方法来复制有角度的位图,然后从中裁剪。不是最高效的内存,但应该可以工作。simplest way i can think of doing it is getting a temporary bitmap and use the
draw
method to duplicate the angled bitmap, then crop in from that. not the most memory efficient, but should work.