View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide

塗りつぶして遊ぶ

back

塗りつぶして遊ぶです。
キャプチャ画像のカーソルで指定したポイントの色を変えまする。
透明色にするのもやります。
ちなみにベタ塗りの部分しか塗りつぶせないし。


ソースコードを順番にドゥ〜イットしてみてください。
Alt + d ( Cmd + d )


●キャプチャ用にスケッチ・モーフを用意しました。
これをドゥ〜イットして適当なところに置いて
キャプチャしちゃってくださいませな。
--------------------------------------------
fc _ HTTPSocket httpGif: 'http://www.languagegame.org:8080/zoo/uploads/smple1.gif'.
sk _ SketchMorph withForm: fc .
sk openInHand.
--------------------------------------------


■指定した色で塗りつぶす。

まずカラーパレットが表示されるので塗りつぶしの色を選んでちょ。
カーソルが'「’に変わりますからキャプチャする領域をドラッグで指定よん。
最後にカーソルが'+'に変わったらキャプチャ領域内の塗りつぶしたい場所を指定でござる。

--------------------------------------------
| f r c interiorPoint |
c _ Color fromUser.
r _ Rectangle fromUser.
f _ Form extent: (r width @ r height) depth: 32.
f _ Display copy: r.
Cursor crossHair showWhile:
	[interiorPoint _ Sensor waitButton - r origin].
Cursor execute showWhile:
	[f shapeFill: c interiorPoint: interiorPoint].
sk _ SketchMorph withForm: f.
sk openInWorld.

--------------------------------------------





■透明色で塗りつぶす

カーソルが'「’に変わりますからキャプチャする領域をドラッグで指定ねす。
最後にカーソルが'+'に変わったらキャプチャ領域内の透明にしたい場所を指定しまする。
--------------------------------------------
| f r interiorPoint |
r _ Rectangle fromUser.
f _ Form extent: (r width @ r height) depth: 32.
f _ Display copy: r.
Cursor crossHair showWhile:
	[interiorPoint _ Sensor waitButton - r origin].
Cursor execute showWhile:
	[f shapeFill: Color transparent interiorPoint: interiorPoint].
sk _ SketchMorph withForm: f.
sk openInWorld.

--------------------------------------------




下の入力ボックスに書き込んで”add to the page”ボタンで登録出来ます。
修正したい場合はページ左のアイコンの”edit”で出てくる画面で編集可能です。
ページ左のアイコンの”uploads”で画像(JPEG,GIF,PNG)のアップロードもできます。


Link to this Page