soccer jersey forums.silverfrost.com :: View topic - %gr, metafiles and clipboard
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

%gr, metafiles and clipboard

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
steveDoyle



Joined: 04 Sep 2009
Posts: 112
Location: Manchester

PostPosted: Tue Mar 12, 2024 12:19 pm    Post subject: %gr, metafiles and clipboard Reply with quote

Does anybody have a simple example of getting a %gr image onto the clipboard

The method have been using has stopped working

thanks

steve
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 726
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Tue Mar 12, 2024 1:37 pm    Post subject: Reply with quote

This works for me. (FTN ver 9.00). After pressing the TOCB menu item, I can paste the graphics region into word etc.

Code:
winapp
module s_mod
use clrwin
implicit none
integer gw, gh

contains

  subroutine setup
  integer iw
  gw = 0.8*clearwin_info@('SCREEN_WIDTH')
  gh = 0.8*clearwin_info@('SCREEN_DEPTH')
  iw = winio@('%mn[Exit]&','Exit')
  iw = winio@('%mn[TOCB]&',TO_CB)   !Copy %gr to clipboard.
  iw = winio@('%gr[red]&',gw,gh)
  iw = winio@('')
  end subroutine setup

  integer function TO_CB()
  integer i
    i = GRAPHICS_TO_CLIPBOARD@(0,0,gw-1,gh-1)
    if (i .eq. 1) print*, 'Success. Graphics region copied to clipboard.'
    if (i .ne. 1) print*, 'Failed. Graphics region not copied to clipboard.'
    TO_CB = 2
  end function TO_CB

end module s_mod

program main
use s_mod
call setup
end
Back to top
View user's profile Send private message Visit poster's website
steveDoyle



Joined: 04 Sep 2009
Posts: 112
Location: Manchester

PostPosted: Tue Mar 12, 2024 2:56 pm    Post subject: Reply with quote

Kenneth

your solution resolved the issues

Im still having problems using metafiles_to_clipboard() (EMF files) but this is not critical

thanks

steve
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group