Hi, how did you make it export whole TRCanvas, not only current view? My
exporter temporarily resizes morph to match canvas extent and then it calls
this your code, but I have issues for large canvases, like for alexandre's
example few mails ago. Issues like canvas shifted to the side replaced by
black color, whole image white, etc.
I was originally using
PNGReadWriter putForm: canvas morph imageForm onFileNamed: fileName
but there seem to come such problems even with smaller canvases.
Jan
Chris Cunningham wrote
Nah, morphic works. What you do is have it write to a
canvas big enough to
hold the drawing, then get the form under it, and then save that out. So,
something like this in the morph:
asForm
| canvas |
canvas := FormCanvas extent: self extent.
self drawOn: canvas.
^canvas contentsOfArea: bounds
and write it out with:
PNGReadWriter putForm: morph asForm onFileNamed: 'someFileName.png'
I've used this with rediculously large diagrams before.
-chris
On Thu, Nov 13, 2014 at 3:40 PM, Nicolai Hess <
nicolaihess@
> wrote:
> 2014-11-13 20:11 GMT+01:00 Alexandre Bergel <
alexandre.bergel@
>:
>
>> no no no :-(
>>
>> It does not work for large pictures. Consider the following:
>>
>>
>> | b |
>> b := RTMondrianViewBuilder new.
>> b shape rectangle
>> withBorder;
>> width: [ :cls | cls numberOfVariables * 5];
>> height: #numberOfMethods;
>> linearFillColor: #numberOfLinesOfCode within: RTObject
>> withAllSubclasses.
>> b nodes: (Object withAllSubclasses copyFrom: 1 to: 3000).
>> b edgesFrom: #superclass.
>> b treeLayout.
>> b build.
>> ^ b view
>>
>> Nothing gets on the disk when you save :-(
>>
>
> this may be an issue with cairo rending on a (really) big surface.
> I bet you won't be able to render that big images with morphic.
> (morphic only renders/exports the visible part).
>
>
>
>
>
>
>>
>> Jan B. sent me a morphic based exporter.
>>
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel
http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>> On Nov 13, 2014, at 12:36 PM, Alexandre Bergel <
alexandre.bergel@
>
>> wrote:
>>
>> Hi Doru!
>>
>> I have reviewer & improved the PNG exporter. I have tried it in my
>> different situation, it seems to work well.
>> I have taken the decision to __not__ render fixed trachel shapes. I
>> think
>> this is okay in most of the cases we will face.
>>
>> Let me know!
>>
>> Cheers,
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel
http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>> On Nov 12, 2014, at 12:43 PM, Tudor Girba <
tudor@
> wrote:
>>
>> Hi Alex,
>>
>> Could you please review the code in RTPNGExporter? We still get a little
>> problem when exporting because it seems that there is a bit of clipping
>> happening on the bottom and to the right.
>>
>> Cheers,
>> Doru
>>
>>
>> --
>>
www.tudorgirba.com
>>
>> "Every thing has its own flow"
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>>
Moose-dev@.unibe
>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>>
Moose-dev@.unibe
>
>>
>>
>
> _______________________________________________
> Moose-dev mailing list
>
Moose-dev@.unibe
_______________________________________________
Moose-dev mailing list
Moose-dev@.unibe
--
View this message in context:
http://forum.world.st/RTPNGExporter-review-needed-tp4789868p4790147.html
Sent from the Moose mailing list archive at
Nabble.com.