Take a snapshot programatically

Help
2013-10-08
2015-11-07
  • David Monarchi

    David Monarchi - 2013-10-08

    Hello -

    I would like to be able to take a snapshot of each graph in a set of graphs, the same thing that can be done using the icon on the toolbar. I searched the documentation, but perhaps wasn't framing my question correctly. If any one can help me with this, I would very much appreciate it. (I can successfully find the graphs I want in the tree; I just can't figure out how to execute the call to take the snapshot.)

    Thank you.

    Best,
    David

     
  • Melançon Guy

    Melançon Guy - 2015-10-30

    Hi David, have you had an answer to your question ? I am precisely trying to do the same ...

    Guy

     
  • David Monarchi

    David Monarchi - 2015-11-06

    Hi Guy -

    I had some limited success in exporting snapshots. The command I used was
    nodeLinkView.saveSnapshot(aFileName, aWidth, aHeight)
    where the file extension on the name specifies the type (e.g., tiff, jpg, png).

    I could get the command to work, but sometimes it cut off parts of the image. I believe the crux of the problem may be that I could never find out what the units are for width and height. They don't appear to be pixels. I posted a fairly detailed question about this 2014-06-16 at
    https://sourceforge.net/p/auber/discussion/206283/thread/18ddd92c/
    but I never received a reply. (I never received a reply to this post either.)

    If you have any insights, I would like to hear them.

    Thanks.

    David

     
    • brenoust

      brenoust - 2015-11-07

      Dear Guy and David,

      I had a closely related question on the export of high resolution graphs so
      the pictures could
      be zoomed on.
      Maybe it'd more help on your second thread David.
      It's not directly answering your point, but hopefully can help
      investigating it.

      Actually the unit seems to be the rendering resolution, so I guess it is in
      pixels.
      From here, I am quoting Patrick who invited me to look at the file:
      library/tulip-gui/src/SnapshotDialog.cpp in which there is the constructor
      of SnapshotDialog.

      Here, the limits for width and height are set by OpenGL and the values are
      stored in:
      GL_MAX_TEXTURE_SIZE

      This value depends on the graphic card of the machine running Tulip. This
      is the
      max value for the largest dimension. On his machine, with an NVidia Quadro
      2000M
      with 2G of memory, the value for GL_MAX_TEXTURE_SIZE is 16384. But he could
      at best get an image of 10000 as the largest dimension.

      In Tulip's code, to be sure to have a correct picture generated, the value
      that is kept
      is actually half the value of GL_MAX_TEXTURE_SIZE, that's why the highest
      value
      in my case is 8192 for the highest dimension.

      I hope this can help you both in understanding the weird behaviors you've
      been
      noticing!

      Cheers,

      Benjamin

      On 7 November 2015 at 08:30, David Monarchi monarchi@users.sf.net wrote:

      Hi Guy -

      I had some limited success in exporting snapshots. The command I used was
      nodeLinkView.saveSnapshot(aFileName, aWidth, aHeight)
      where the file extension on the name specifies the type (e.g., tiff, jpg,
      png).

      I could get the command to work, but sometimes it cut off parts of the
      image. I believe the crux of the problem may be that I could never find out
      what the units are for width and height. They don't appear to be pixels. I
      posted a fairly detailed question about this 2014-06-16 at
      https://sourceforge.net/p/auber/discussion/206283/thread/18ddd92c/
      but I never received a reply. (I never received a reply to this post
      either.)

      If you have any insights, I would like to hear them.

      Thanks.

      David

      Take a snapshot programatically
      https://sourceforge.net/p/auber/discussion/206283/thread/966bbbcf/?limit=25#2db4


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/auber/discussion/206283/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • David Monarchi

    David Monarchi - 2015-11-07

    Thanks, Benjamin. The clarification is much appreciated. I hope that this information will be added to the documentation with the next release; it would save a lot of trial-and-error trying to determine the allowable range for those numbers. :-) Now I can return to my code to see if I can avoid the clipping that is occuring on the edges.

    Cheers,
    David

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks