On 20 September 2013 14:16, Torsten Bergmann <[email protected]> wrote:

> Stef wrote:
> >look for the AthensScene…
>
> Thanks, did'n see the class comment there. Just for the records if anyone
> needs it:
>
>
> Display in Pharo:
> ===========
>
> surface := AthensCairoSurface extent: 100@100.
> surface drawDuring: [:canvas |
>         canvas surface clear:  Color black.
>         canvas setPaint: (Color red).
>         canvas setShape: (-20@ -20 corner: 20@ 20).
>         canvas draw.
> ].
> imageForm := surface asForm.
> form asMorph openInWorld
>
>
> Display in Seaside:
> =============
>
> renderContentOn: html
>     html imageForm: ...   "add your image form here"
>
> i am not sure this will work, since transferring image via net requires
direct acces to form's bits,
while cairo surface form is just a reference to its corresponding cairo
surface.

so, in order to get access to its pixels you must blit it to own 32bpp Form:

surfForm := surface asForm.

destForm := Form extent: surface extent depth: 32.
destForm canvas drawImage: surfForm at: 0@0.
html imageForm: destForm

(something like that).


-- 
Best regards,
Igor Stasenko.

Reply via email to