1

iPhone/iPad用のペイント系アプリを開発しようとしています。70% 完了しましたが、1 つの機能を完了するのに時間がかかっています。選択した領域を選択した色で塗りつぶす機能を追加しました。実行しましたが、時間がかかるか、動作が遅すぎます。この機能により、アプリ全体がフリーズします。Drawing View の構造 :- UIView(Parent View) -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.
4

2 に答える 2

0

私はこれを見つけました、そしてそれは私にとって御馳走でした!

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

実装も非常に簡単です。

于 2015-01-09T10:10:49.887 に答える
0

スタック ベースのフラッド フィルを使用する: http://www.drowningintechnicaldebt.com/ShawnWeisfeld/archive/2006/12/04/stack-based-flood-fill-algorithm.aspx

于 2011-09-23T10:09:29.733 に答える