Text in the corner of a rendered image
-
hi everybody!
is it possible to create a text in the corner of an image that is rendered with view.write_image at which the resolution of the rendered image differs from the width and height of the current view.
for example:current view = 1600*1200
an image rendered with view.write_image 800, 800
(to save information of the current model on the image)
thanks for your time.
tim -
I don't know if there is a more elegant way, I would just temporarily create an onscreen text and delete it later:
model.add_note "test", 0.1, 0.1
whereas 0.1 = 10% of the viewport width/height -
soungs good. and how to delete the note?
-
i know meanwhile how to...
thanks a lot. -
I posted a blurp at the bottom of the API page:
@dan said:
Model.add_note
returns a Sketchup::Text object associated with the View (has no point, leader or arrow.)
[ie, there is no such object class as Note or Sketchup::Note.]Bug: (on PC as of v7.1,) The note (Text object,) will NOT be displayed if there are no other DrawingElements to render. A note added to an empty model will not be displayed until some element is added to the model. If all other DrawingElements execpt the note are deleted, the note will NOT be displayed (but is still in the Entities collection.)
So modify the previous example:
mynote = model.add_note "test", 0.1, 0.1
... later in the code, delete the Sketchup::Text object referenced by mynote
mynote.erase!
or
Sketchup.active_model.entities.erase_entities( mynote )
Advertisement