Silverfrost Forums

Welcome to our forums

Save full %gr

9 Sep 2014 8:23 #14607

John Horspool suggested ones here how to save the full OpenGL screen. How his brilliant hack works without allocating any memory is still not quite clear to me. You can find it here using Search.

Now I wish again that %og and %gr were absolutely the same allowing using same controls and graphics library calls. Unfortunately they are from different planets

I say that because I need the same feature of saving entire usual %gr screen. I have that implemented for highlighted portion of the screen. You just highlight needed part with the mouse (rubber band it) and Ctrl+C to place it into clipboard. Then you can do whatever you want - either to Ctrl+S to save to graphics file or Ctrl+V to new window or Photoshop. This is done extremely easy in Clearwin+ (it's just classical example why we need GUI builders like CWP) with just one single line

    i = winio@('%ac[Ctrl+C]&','Copy')

and that's basically by 90% all. You can then either see that in new widnow

 i = winio@('%ac[Ctrl+V]&','Paste')

or save to file of different formats like PNG, PCX, BMP, GIF or JPG etc with few more Fortran text lines

But sometimes i need to save exactly the same size images for comparison or movies and my way of highlighting + saving fails because you always miss by one-two pixels. This can be done via multiple lines of Fortran text using CWP, putting stuff into huge array sucking last bits from 3-4GB of memory 32bit compiler allows but may be you can share the subroutines ?

9 Sep 2014 8:49 (Edited: 10 Sep 2014 5:14) #14608

Dan, you wrote 'I say that because I need the same feature of saving entire usual %gr screen.' I'm not really sure what you mean, but using the export_image@ function (and nothing else but this) you will get the whole visible %gr area as BMP or JPG or ... file. But I think that you want to do something different?

      j = winio@('%`gr[rgb_colours]',...,handle)
       ...
      j = select_graphics_object@(handle)
       ...
      j = export_image@('my_file.jpg')

Wilfried

10 Sep 2014 5:14 #14609

As to something different I thought also about putting the whole %gr area into clipboard. But your suggestion is basically enough good for me. I use that function but was confused and thought that it is saving only selected area (how it works in my case). Thanks Wilfried.

Please login to reply.