how to programmatically export a png with roassal?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

how to programmatically export a png with roassal?

Tudor Girba-2
Hi,

I am trying to find a way to obtain a bitmap programmatically with a Roassal visualization. I try this:

| view |
view := ROMondrianViewBuilder new.
view nodes: (1 to: 10).
view raw bitmap

The problem is that the nodes are not yet laid out. As far as I remember, this used to work.

How do I trigger the layouts easily?

Cheers,
Doru


--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: how to programmatically export a png with roassal?

Uko2
I was using

saveFileFrom: view named: aString
| writeStream |
writeStream := ((FileSystem workingDirectory / (aString, '.png')) writeStream.
[ (ROPharoImageExporter new view: view) exportWith: PNGReadWriter onStream: writeStream ] 
ensure: [ writeStream ifNotNil: #close ]

On 17 Nov 2013, at 12:45, Tudor Girba <[hidden email]> wrote:

Hi,

I am trying to find a way to obtain a bitmap programmatically with a Roassal visualization. I try this:

| view |
view := ROMondrianViewBuilder new.
view nodes: (1 to: 10).
view raw bitmap

The problem is that the nodes are not yet laid out. As far as I remember, this used to work.

How do I trigger the layouts easily?

Cheers,
Doru


--

"Every thing has its own flow"
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: how to programmatically export a png with roassal?

Tudor Girba-2
Thanks, but this is not enough.

This method would work just like #bitmap would. But, before using this method the layout has to be applied first.

In the meantime, I found the method in ROMondrianViewBuilder>>#applyLayout.

So, this will work fine:
| view |
view := ROMondrianViewBuilder new.
view nodes: (1 to: 10).
view applyLayout.
view raw bitmap asMorph exportAsPNG

Cheers,
Doru





On Sun, Nov 17, 2013 at 12:49 PM, Yuriy Tymchuk <[hidden email]> wrote:
I was using

saveFileFrom: view named: aString
| writeStream |
writeStream := ((FileSystem workingDirectory / (aString, '.png')) writeStream.
[ (ROPharoImageExporter new view: view) exportWith: PNGReadWriter onStream: writeStream ] 
ensure: [ writeStream ifNotNil: #close ]

On 17 Nov 2013, at 12:45, Tudor Girba <[hidden email]> wrote:

Hi,

I am trying to find a way to obtain a bitmap programmatically with a Roassal visualization. I try this:

| view |
view := ROMondrianViewBuilder new.
view nodes: (1 to: 10).
view raw bitmap

The problem is that the nodes are not yet laid out. As far as I remember, this used to work.

How do I trigger the layouts easily?

Cheers,
Doru


--

"Every thing has its own flow"
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: how to programmatically export a png with roassal?

abergel
Yes, applyLayout does the think. Maybe I can insert a call to applyLayout in bitmap.

Alexandre

Le 17-11-2013 à 9:10, Tudor Girba <[hidden email]> a écrit :

Thanks, but this is not enough.

This method would work just like #bitmap would. But, before using this method the layout has to be applied first.

In the meantime, I found the method in ROMondrianViewBuilder>>#applyLayout.

So, this will work fine:
| view |
view := ROMondrianViewBuilder new.
view nodes: (1 to: 10).
view applyLayout.
view raw bitmap asMorph exportAsPNG

Cheers,
Doru





On Sun, Nov 17, 2013 at 12:49 PM, Yuriy Tymchuk <[hidden email]> wrote:
I was using

saveFileFrom: view named: aString
| writeStream |
writeStream := ((FileSystem workingDirectory / (aString, '.png')) writeStream.
[ (ROPharoImageExporter new view: view) exportWith: PNGReadWriter onStream: writeStream ] 
ensure: [ writeStream ifNotNil: #close ]

On 17 Nov 2013, at 12:45, Tudor Girba <[hidden email]> wrote:

Hi,

I am trying to find a way to obtain a bitmap programmatically with a Roassal visualization. I try this:

| view |
view := ROMondrianViewBuilder new.
view nodes: (1 to: 10).
view raw bitmap

The problem is that the nodes are not yet laid out. As far as I remember, this used to work.

How do I trigger the layouts easily?

Cheers,
Doru


--

"Every thing has its own flow"
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev