On 27 March 2013 14:44, Tristan Bourgois <tristan.bourgois@gmail.com> wrote:
2013/3/26 Igor Stasenko <siguctua@gmail.com>:
On 26 March 2013 11:29, Tristan Bourgois <tristan.bourgois@gmail.com> wrote:
2013/3/25 Stéphane Ducasse <stephane.ducasse@inria.fr>:
Begin forwarded message:
From: Igor Stasenko <siguctua@gmail.com> Subject: Re: Some question and request for Athens Date: March 25, 2013 2:57:33 PM GMT+01:00 To: Tristan Bourgois <tristan.bourgois@gmail.com> Cc: Stéphane Ducasse <stephane.ducasse@inria.fr>, LE PORS Eric <eric.lepors@fr.thalesgroup.com>
On 25 March 2013 11:45, Tristan Bourgois <tristan.bourgois@gmail.com> wrote:
Hi Igor!
I have some questions and request for Athens :)
1 Do exist a possibility in Athens to draw a Surface on a Surface? For example : aSurf drawSurface: anOtherSurface at: aPosition (I need it for draw image on a surface)
yes. You can use Forms or surfaces as paints so they act like 2D textures:
canvas setPaint: someSurface. canvas drawShape: myRect.
Thanks that's works fine :)
2 About my first question, I try to draw a png image on a Surface and I get some strange behavior. When nothing is applied on my first surface and draw the image in a rectangle path I crash the VM! This an example I tried and crash my VM:
|surf pharoLogo ref path patternPaint| surf := AthensCairoSurface extent: 600@600.
ref := 'pharo.png' asFileReference. pharoLogo := AthensCairoSurface createFromFile: ref fullName ifFailed:[nil].
surf drawDuring: [:can| surf clear. patternPaint := can setPaint: pharoLogo. patternPaint setExtend: #None. can drawShape: (0@0 extent: pharoLogo extent). ]. Display getCanvas drawImage: surf asForm at: 0@0.
Did this code work fine on your image or other machine? (I'm working on a Windows XP pro)
could be a problem. we should check. To workaround this, you can try to load .png into a form: Form fromBynaryStream: (ref ... readStream)
If you need more information about the crash and my environment ask it :)
weird... it should be working fine.
I try it on a new clean image and again get a VM crash.
okay, then i need more information :)
I send the report of the crash in the mail.
yes, i see there's some problem.. but cannot tell anything why it happens.
Tristan
-- Best regards, Igor Stasenko.
-- Best regards, Igor Stasenko.