How to convert properyl an Athens Surface to a Form
Hi, I can't find it. #asForm message produce odd result for me. Hilaire
the best way is to blit surface on the morphic canvas using displayOnMorphicCanvas: canvas at: aPoint method. On 19 June 2014 22:16, Nicolai Hess <nicolaihess@web.de> wrote:
I use asForm and it works for me. can you create a screenshot with the odd result it creates.
2014-06-19 21:58 GMT+02:00 Hilaire Fernandes <hilaire.fernandes@gmail.com> :
Hi,
I can't find it. #asForm message produce odd result for me.
Hilaire
-- Best regards, Igor Stasenko.
but I don't want to display but a properly converted Form. Hilaire Le 20/06/2014 12:55, Igor Stasenko a écrit :
displayOnMorphicCanvas: canvas at: aPoint method.
-- Dr. Geo http://drgeo.eu iStoa - https://launchpad.net/istoa
Hello, I tried this but it produces empty form. |canvas | canvas := (Form extent: aDrgeo area athensSurface extent depth: 32) getCanvas. aDrgeo area athensSurface displayOnMorphicCanvas: canvas at: 0@0. canvas form Hilaire Le 20/06/2014 12:55, Igor Stasenko a écrit :
the best way is to blit surface on the morphic canvas using displayOnMorphicCanvas: canvas at: aPoint method.
-- Dr. Geo http://drgeo.eu iStoa - https://launchpad.net/istoa
Here, I create a ImageMorph from a Form. And the forms canvas is used to render an AthensWrapMorph. The important point is, fullDrawOn: instead of drawOn: |form wrap background| form:=(Form extent:(400@400)depth:32). wrap:=AthensWrapMorph new. wrap extent:400@400. background := Morph new extent:400@400. background color:Color white. wrap addMorph:background. background addMorph: Morph new. wrap. wrap fullDrawOn:form getCanvas. (ImageMorph withForm: form) openInWorld 2014-06-21 9:23 GMT+02:00 Hilaire Fernandes <hilaire.fernandes@gmail.com>:
Hello,
I tried this but it produces empty form.
|canvas | canvas := (Form extent: aDrgeo area athensSurface extent depth: 32) getCanvas. aDrgeo area athensSurface displayOnMorphicCanvas: canvas at: 0@0. canvas form
Hilaire
Le 20/06/2014 12:55, Igor Stasenko a écrit :
the best way is to blit surface on the morphic canvas using displayOnMorphicCanvas: canvas at: aPoint method.
-- Dr. Geo http://drgeo.eu iStoa - https://launchpad.net/istoa
Thanks Nicolai, I get results with #fullDrawnOn: My felling: it should not get that complicated. Hilaire Le 21/06/2014 10:29, Nicolai Hess a écrit :
Here, I create a ImageMorph from a Form. And the forms canvas is used to render an AthensWrapMorph. The important point is, fullDrawOn: instead of drawOn:
|form wrap background| form:=(Form extent:(400@400)depth:32). wrap:=AthensWrapMorph new. wrap extent:400@400. background := Morph new extent:400@400. background color:Color white. wrap addMorph:background. background addMorph: Morph new. wrap. wrap fullDrawOn:form getCanvas. (ImageMorph withForm: form) openInWorld
2014-06-21 9:23 GMT+02:00 Hilaire Fernandes <hilaire.fernandes@gmail.com <mailto:hilaire.fernandes@gmail.com>>:
Hello,
I tried this but it produces empty form.
|canvas | canvas := (Form extent: aDrgeo area athensSurface extent depth: 32) getCanvas. aDrgeo area athensSurface displayOnMorphicCanvas: canvas at: 0@0. canvas form
Hilaire
Le 20/06/2014 12:55, Igor Stasenko a écrit : > the best way is to blit surface on the morphic canvas > using > displayOnMorphicCanvas: canvas at: aPoint > method. >
-- Dr. Geo http://drgeo.eu iStoa - https://launchpad.net/istoa
-- Dr. Geo http://drgeo.eu iStoa - https://launchpad.net/istoa
On 21 June 2014 09:23, Hilaire Fernandes <hilaire.fernandes@gmail.com> wrote:
Hello,
I tried this but it produces empty form.
|canvas | canvas := (Form extent: aDrgeo area athensSurface extent depth: 32) getCanvas. aDrgeo area athensSurface displayOnMorphicCanvas: canvas at: 0@0. canvas form
should not.. try to #flush operations on surface before blitting it to form.
Hilaire
Le 20/06/2014 12:55, Igor Stasenko a écrit :
the best way is to blit surface on the morphic canvas using displayOnMorphicCanvas: canvas at: aPoint method.
-- Dr. Geo http://drgeo.eu iStoa - https://launchpad.net/istoa
-- Best regards, Igor Stasenko.
2014-06-25 0:21 GMT+02:00 Igor Stasenko <siguctua@gmail.com>:
On 21 June 2014 09:23, Hilaire Fernandes <hilaire.fernandes@gmail.com> wrote:
Hello,
I tried this but it produces empty form.
|canvas | canvas := (Form extent: aDrgeo area athensSurface extent depth: 32) getCanvas. aDrgeo area athensSurface displayOnMorphicCanvas: canvas at: 0@0. canvas form
should not.. try to #flush operations on surface before blitting it to form.
Hilaire
Le 20/06/2014 12:55, Igor Stasenko a écrit :
the best way is to blit surface on the morphic canvas using displayOnMorphicCanvas: canvas at: aPoint method.
-- Dr. Geo http://drgeo.eu iStoa - https://launchpad.net/istoa
-- Best regards, Igor Stasenko.
This works for me: | sur form | sur := AthensCairoSurface extent: 300 @ 300. sur drawDuring: [ :can | can pathTransform restoreAfter: [ can surface clear: Color black. can pathTransform translateX: 150 Y: 150. can setPaint: (Color green alpha: 0.1). can setShape: (-150 @ -150 corner: 150 @ 150). 20 timesRepeat: [ can draw. can pathTransform scaleBy: 0.85. can pathTransform rotateByDegrees: 10. ] ] ]. form := Form extent: sur extent depth: 32. sur displayOnMorphicCanvas: form getCanvas at: 0 @ 0. (ImageMorph withForm: form) openInHand
The black background should be white. I use asFrom: area owner athensSurface asForm where owner is a WrapAthenMorph Hilaire Le 19/06/2014 22:16, Nicolai Hess a écrit :
I use asForm and it works for me. can you create a screenshot with the odd result it creates.
-- Dr. Geo http://drgeo.eu iStoa - https://launchpad.net/istoa
participants (3)
-
Hilaire Fernandes -
Igor Stasenko -
Nicolai Hess