为 UIView 上层的选定区域填充颜色

发布于 2024-11-30 09:25:27 字数 937 浏览 1 评论 0原文

我正在尝试为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.

I am trying to develop paint type App for iPhone/iPad. I have done 70% but one functionality is taking time to complete it. I have added To Fill Selected Area with Selected Color functionality inside it. I did it but it is taking to much time or working too slow. Due to this functionality, whole App become freeze.
Structure of Drawing View :-
UIView(Parent View)
-UIImageView(SubView1)-To keep image as a background
-UIImageView(SubView2)-To draw color or draw line

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文