scale _ 1. penWidth _ 5. f1 _ Form fromUser. c1 _ FormCanvas extent: f1 extent. c1 paintImage: f1 at: 0@0. sk1 _ SketchMorph withForm: c1 form. sk1 openInHand.
r0 _ Rectangle fromUser. r1 _ PolygonMorph new openInWorld. verts _ r0 corners. r1 setVertices: verts. r1 borderWidth: 1. r1 color: Color transparent. r1 borderColor: Color black. r1 dashedBorder: {5. 5. Color white. 0. 1}. sk1 addMorph: r1. nowPt _ sk1 position - r1 position. c2 _ FormCanvas extent: r1 extent. c2 paintImage: c1 form at: nowPt. sk2 _ SketchMorph withForm: c2 form. sk2 openInHand.
| col fd lastPt str | col _ Color fromUser. str _ FillInTheBlank request: 'ペンの太さ' initialAnswer: '5'. str = '' ifTrue:[^nil]. penWidth _ str asInteger. [Sensor anyButtonPressed] whileFalse. fd _ FormCanvas on: Display. [Sensor yellowButtonPressed] whileFalse: [ lastPt _ Sensor cursorPoint. [Sensor redButtonPressed] whileTrue:[ nextPt _ Sensor cursorPoint. fd line: lastPt to: nextPt width: penWidth color: col. c1 line: (lastPt - sk1 position) to: (nextPt - sk1 position) width: penWidth color: col. lastPt _ nextPt.]. sk1 form: c1 form. c2 paintImage: c1 form at: nowPt. sc _ c2 form magnify: c2 form boundingBox by: (1@1 * scale). sk2 form: sc. Display restore.]
| col interiorPoint | col _ Color fromUser. Cursor crossHair showWhile: [interiorPoint _ Sensor waitButton - sk1 position]. Cursor execute showWhile: [c1 form shapeFill: col interiorPoint: interiorPoint]. sk1 form: c1 form. c2 paintImage: c1 form at: nowPt. sc _ c2 form magnify: c2 form boundingBox by: (1@1 * scale). sk2 form: sc.
r3 _ Rectangle fromUser. c3 _ FormCanvas extent: r3 extent. c3 paintImage: c1 form at: ( sk1 position - r3 origin). sk3 _ SketchMorph withForm: c3 form. sk3 openInHand.
c1 paintImage: c3 form at: (sk3 position - sk1 position). sk1 form: c1 form. c2 paintImage: c1 form at: nowPt. sc _ c2 form magnify: c2 form boundingBox by: (1@1 * scale). sk2 form: sc.
| col interiorPoint | col _ Color fromUser. Cursor crossHair showWhile: [interiorPoint _ Sensor waitButton - sk3 position]. Cursor execute showWhile: [c3 form shapeFill: col interiorPoint: interiorPoint]. sk3 form: c3 form.
| col fd lastPt | col _ Color red. penWidth _ 2. bf _ FormCanvas extent: c1 extent. [Sensor anyButtonPressed] whileFalse. fd _ FormCanvas on: Display. [Sensor yellowButtonPressed] whileFalse: [ lastPt _ Sensor cursorPoint. [Sensor redButtonPressed] whileTrue:[ nextPt _ Sensor cursorPoint. fd line: lastPt to: nextPt width: penWidth color: col. bf image: c3 form at: (nextPt - sk1 position) sourceRect: (0@0 corner: c3 extent) rule: 7. lastPt _ nextPt.]. c1 paintImage: bf form at: 0@0. sk1 form: c1 form. c2 paintImage: c1 form at: nowPt. sc _ c2 form magnify: c2 form boundingBox by: (1@1 * scale). sk2 form: sc. Display restore.]
| str | col _ Color fromUser. str _ FillInTheBlank request: 'ブラシサイズ' initialAnswer: '5'. str = '' ifTrue:[^nil]. dotSize _ str asInteger. brush _ FormCanvas extent: dotSize @ dotSize. brush fillOval: (0@0 corner: brush extent) color: col. bf _ FormCanvas extent: c1 extent. [Sensor anyButtonPressed] whileFalse. fd _ FormCanvas on: Display. [Sensor yellowButtonPressed] whileFalse: [ lastPt _ Sensor cursorPoint. [Sensor redButtonPressed] whileTrue:[ nextPt _ Sensor cursorPoint. fd line: lastPt to: nextPt width: 2 color: col. bf image: brush form at: (nextPt - sk1 position) sourceRect: (0@0 corner: bf extent) rule: 7. lastPt _ nextPt.]. c1 paintImage: bf form at: 0@0. sk1 form: c1 form. c2 paintImage: c1 form at: nowPt. sc _ c2 form magnify: c2 form boundingBox by: (1@1 * scale). sk2 form: sc. Display restore.]
| str | str _ FillInTheBlank request: 'スケール' initialAnswer: '1'. str = '' ifTrue:[^nil]. scale _ str asInteger. r1 extent: r0 extent / scale. nowPt _ sk1 position - r1 position. c2 _ FormCanvas extent: r1 extent. c2 paintImage: c1 form at: nowPt. sc _ c2 form magnify: c2 form boundingBox by: (1@1 * scale). sk2 form: sc.
[Sensor anyButtonPressed] whileFalse. [[Sensor anyButtonPressed] whileTrue:[ World activeHand dropMorphs. r1 center: Sensor cursorPoint. nowPt _ sk1 position - r1 position. c2 fillColor: Color gray. c2 paintImage: c1 form at: nowPt. sc _ c2 form magnify: c2 form boundingBox by: (1@1 * scale). sk2 form: sc]]fork.
| col fd lastPt str | col _ Color fromUser. str _ FillInTheBlank request: 'ペンの太さ' initialAnswer: '5'. str = '' ifTrue:[^nil]. penWidth _ str asInteger. [Sensor anyButtonPressed] whileFalse. fd _ FormCanvas on: Display. [Sensor yellowButtonPressed] whileFalse: [ lastPt _ Sensor cursorPoint. [Sensor redButtonPressed] whileTrue:[ nextPt _ Sensor cursorPoint. lpt _ ((lastPt - sk2 position) // scale) + (r1 position - sk1 position). npt _ ((nextPt - sk2 position) // scale) + (r1 position - sk1 position). fd line: lastPt to: nextPt width: penWidth * scale color: col. c1 line: lpt to: npt width: penWidth color: col. lastPt _ nextPt.]. sk1 form: c1 form. c2 paintImage: c1 form at: nowPt. sc _ c2 form magnify: c2 form boundingBox by: (1@1 * scale). sk2 form: sc. Display restore.]
| col interiorPoint | col _ Color fromUser. Cursor crossHair showWhile: [interiorPoint _ ((Sensor waitButton - sk2 position) // scale) + (r1 position - sk1 position)]. Cursor execute showWhile: [c1 form shapeFill: col interiorPoint: interiorPoint]. sk1 form: c1 form. c2 paintImage: c1 form at: nowPt. sc _ c2 form magnify: c2 form boundingBox by: (1@1 * scale). sk2 form: sc.
下の入力ボックスに書き込んで”add to the page”ボタンで登録出来ます。 修正したい場合はページ左のアイコンの”edit”で出てくる画面で編集可能です。 ページ左のアイコンの”uploads”で画像(JPEG,GIF,PNG)のアップロードもできます。 Sunday, 11 July 2004, 5:11:40 am 道は果てしなく遠そうだすな・・・やれやれ。--thoru Link to this Page
|