Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Apr 26, 2017 4:52 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Print Screenshot / vb6 PrintForm equivalent
PostPosted: Wed Jun 23, 2010 1:02 pm 
Offline

Joined: Wed Jun 23, 2010 12:38 pm
Posts: 14
'--------------------------------------
' PRINT SCREEN MENU ITEM CODE
'--------------------------------------
Dim pict As Picture
Dim ps As PrinterSetup
Dim g As Graphics
Dim cc,c As Integer

//CREATE PICTURE OBJECT, SELF IS THE FORM WINDOW
pict = NewPicture(self.Width, self.Height, 32)

//CREATE A PICTURE OF THE CURRENT WINDOW
Self.DrawInto pict.Graphics, 0, 0

//THIS WINDOW LOOKS BEST PRINTED AS LANDSCAPE
//SO DEFAULT TO LANDSCAPE MODE
ps = New PrinterSetup
ps.Landscape =True

//PROMPT USER FOR PRINT SETTINGS AND PRINTER
If ps.pageSetupDialog then
g = OpenPrinterDialog(ps)
If g <> Nil Then
//PRINT THE SCREEN
c=g.Copies
For cc=1 To c
g.DrawPicture(pict, 0,0,ps.Width,ps.Height,0,0,pict.Width,pict.Height)
If cc=c Then
//STOP EXTRA BLANK PAGE FROM BEING PRINTED.
g=Nil
Else
g.NextPage
End If
Next cc
End If
End If


Top
 Profile  
 
 Post subject: Re: Print Screenshot / vb6 PrintForm equivalent
PostPosted: Mon Aug 09, 2010 2:32 am 
Offline
User avatar

Joined: Fri Jan 29, 2010 12:39 pm
Posts: 880
Location: Virginia, USA
Thanks! Just what I was looking for! 8)

_________________
RS 2012 r2 Enterprise on Win 7


Top
 Profile  
 
 Post subject: Re: Print Screenshot / vb6 PrintForm equivalent
PostPosted: Mon Aug 09, 2010 3:27 am 
Offline

Joined: Wed Mar 17, 2010 10:33 am
Posts: 258
Location: Sydney, Australia
Thanks for posting that, I'll need exactly that very shortly.

Regards
Denis


Top
 Profile  
 
 Post subject: Re: Print Screenshot / vb6 PrintForm equivalent
PostPosted: Mon Aug 09, 2010 9:11 am 
Offline

Joined: Wed Jun 23, 2010 12:38 pm
Posts: 14
Glad it helps. It was one of those things that took me longer than I thought it should to figure out.
Dave


Top
 Profile  
 
 Post subject: Re: Print Screenshot / vb6 PrintForm equivalent
PostPosted: Mon Aug 09, 2010 10:36 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
This might be a tad bit better [my opinion]

For cc=1 To c
if c>1 then g.next page
g.DrawPicture(pict, 0,0,ps.Width,ps.Height,0,0,pict.Width,pict.Height)
Next cc
g=nil

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
 
 Post subject: Re: Print Screenshot / vb6 PrintForm equivalent
PostPosted: Mon Aug 09, 2010 10:45 am 
Offline

Joined: Wed Jun 23, 2010 12:38 pm
Posts: 14
:) Thanks for the suggestion.
Dave


Top
 Profile  
 
 Post subject: Re: Print Screenshot / vb6 PrintForm equivalent
PostPosted: Thu Feb 07, 2013 4:07 pm 
Offline
User avatar

Joined: Sat Jun 04, 2011 8:29 am
Posts: 387
This works ok to get most of the window...

but I have a panel with a canvas that I draw a graph to... and this code just draws a big gray area.

So I'm guessing I have to capture that separately and manually draw it onto the canvas????

Same with a set of buttons that I draw on there inside a canvas area.

If so how do I draw this on top of the main screen capture???

_________________
Currently using:
Windows XP Pro SP3
Real Studio 2011 Release 4.3 Enterprise
and
Mac OS 10.7.4
Real Studio 2011 Release 4.3 Enterprise
(finally also compiled on Mac)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group