On Thu, 20 Mar 2014, Vasilis Kanatas wrote:
> Thanks Rolf-Werner,
>
> I tried
> Private $hImage As New Image
> and had the same result ! Printing white page!
>
> What I want is to print the labels of a form or ScrollArea!!
>
> I also tried to change the *Printing Example of Gambas 3* to make it work
> for my issue. Here's what I did (3 steps):
>
> 1......I've changed Form_load as following to Grab the contents of
> srcImage.ScrollArea:
>
> Public Sub Form_Open()
>
> Me.Center
>
> txtText.Text = File.Load("molly-malone.txt")
> txtFontText.Text = Font["17"].ToString()
> Try $hImage = scrImage.Grab
> ' $hImage = New Image(scrImage.Width, scrImage.Height)
>
> 'scrImage.ResizeContents($hImage.W, $hImage.H)
> 'scrImage.Refresh
>
> End
>
OK, you come immediately from Gambas 2, right? Control.Grab() worked
completely differently in Gambas 2. It took a screenshot of the control,
as you know.
In Gambas 3 it grabs the mouse and keyboard of the program, so that all
mouse and keyboard events produced are raised under that control's event
name. Look it up in the documentation[0].
So no wonder that your page remains empty, as the image you are painting
is also empty. You noticed that there was some problem with Grab(), right?
You use Try on the Grab() line because it would otherwise raise an error.
That's an indication to look at the documentation, especially if you use a
new major version the first time :-)
Regards,
Tobi
[0] http://gambaswiki.org/wiki/comp/gb.qt4/control/grab
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user