【问题标题】:Fill Color Selected Area in UIView upper Layer在 UIView 上层中填充颜色选定区域
【发布时间】:2011-10-29 20:32:03
【问题描述】:

我正在尝试为 iPhone/iPad 开发绘画类型应用程序。我已经完成了 70%,但其中一项功能需要时间来完成。我在其中添加了使用选定颜色功能填充选定区域。我做到了,但它需要很多时间或工作太慢。由于此功能,整个应用程序变得冻结。 图纸视图的结构:- UIView(父视图) -UIImageView(SubView1)-将图像作为背景 -UIImageView(SubView2)-绘制颜色或画线

In above structure, Parent view is work as a Canvas View and Subview1 is lowerview and Subview2 is upperview.

My approach :-
1)finding currnet point.
2)getting pixtel color.
3)get screen shot for whole screen.
4)get array for those pixtel who have a same pixtel color as select pixtel in current screen shot
5)now we use 4Q pixtel fill color for identifying pixtel who is connected with selected pixtel and making array for all those pixtel.
6)After getting the final array for the pixtel, we draw a pixtel with selected color.

Any one help.
I need a another implementation for Flood fill with a more smooth way functionality.
Pls provide me a Code sample.

Thanks in Advance.

【问题讨论】:

  • 我看过很多洪水填充算法的实现。您是否查看过 Apple 文档和 Core Graphics?您最终解决了这个问题还是仍在寻找?

标签: ios image colors paint flood-fill


【解决方案1】:

我发现了这个,它对我很有用!

https://github.com/Chintan-Dave/UIImageScanlineFloodfill

也很容易实现。

【讨论】:

    【解决方案2】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-04-12
    • 2021-06-23
    • 2012-10-13
    • 2021-10-25
    • 1970-01-01
    • 2012-02-06
    相关资源
    最近更新 更多