Silverfrost Forums

Welcome to our forums

printer to graphic surface using%pl

28 May 2009 6:16 #4642

hi, i have created a graphic surface using %pl, i am unable to attach a printer to that graphics region.

i am aware that it is possible with %`gr by setting a handle to it,but i guess %pl does not have this option.

any help is much appreciated.

thank you.

29 May 2009 6:36 #4643

If you just wanted to do this occasionally then a quick and nasty way would be to copy the screen to the clipboard (using the Print Screen key on the keyboard) and then paste this into Microsoft Paint.

If no one can think of a better way, I will take a look at the ClearWin+ code sometime next week.

2 Jun 2009 4:59 (Edited: 3 Jun 2009 1:40) #4655

As a start you could use the following sample in order to put the image on the clipboard as a metafile.

  WINAPP
  INTEGER ctrl,start_cb,winio@
  EXTERNAL start_cb
  INTEGER N,i
  PARAMETER(N=11)
  REAL*8 x(N),y(N)
  DO i=1,N
    x(i)=i-1
    y(i)=x(i)**2
  ENDDO
  ctrl=999
  i=winio@('%`pl[x_array]&',400,250,N,x,y,ctrl)
  i=winio@('%sc', start_cb)
  END

  INTEGER FUNCTION start_cb()
  INCLUDE <windows.ins>
  INTEGER ctrl
  ctrl = 999
  CALL SIMPLEPLOT_TO_CLIPBOARD@(ctrl)
  start_cb = 1
  END

Then it might be possible to copy from the clipboard into a %gr region say, perhaps using play_clipboard_metafile@.

3 Jun 2009 1:36 #4663

There is another undocumented routine (as well as simpleplot_to_clipboard@). It is the subroutine simpleplot_to_metafile@. It takes two arguments. An integer handle, corresponding to the value used with the grave accent on %pl, followed by a character variable giving the name of the file.

Please login to reply.