[Gambas-user] Print probleem with pictures/text

Ron Onstenk ronstk at ...239...
Sat Jul 22 23:54:09 CEST 2006


On Friday 21 July 2006 08:22, Timothy Marshal-Nichols wrote:
> *** Timothy: The text is taken from a TextArea and should be multi line in
> the print out. The Align options like Center do work.
> 
> What I think you want is a 'WordWrap' option. This is not supported by the
> Draw.Text() method. But it should be possible to use Draw.TextWidth(txt) to
> create a usable version of WordWrap. Evan if it is not perfect.
> ***

You are correct with 'WordWrap'.
In the screen shot the cyan is the size and the text is not wrapped :(

Using next code part:
 bigText = file.Load("garantie.text")
 draw.BackColor = color.Red
 draw.FillColor = color.Green
 draw.ForeColor = color.Yellow
 draw.Transparent = FALSE
 draw.FillColor = color.Cyan
 draw.FillStyle = fill.Solid

 ' Draw.Text(bigText, 100, (Printer.Height / 2) + 100 + (Printer.Height / 4), Printer.Width - 200, Draw.TextHeight(bigText), Align.left)
 ' Draw.Rect(100, (Printer.Height / 2) + 100 + (Printer.Height / 4), Printer.Width - 200, Draw.TextHeight(bigText))
  Draw.Rect(100, (Printer.Height / 2) + 100 + (Printer.Height / 4), 1000, Draw.TextHeight(bigText))
  Draw.Text(bigText, 100, (Printer.Height / 2) + 100 + (Printer.Height / 4), 1000, Draw.TextHeight(bigText), Align.left)

I'll try to make a function for wordwrap or the bigtext must provide the correct width.

Anyway I should be able to more now after all the struggle.

Thanks again

Ron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: draw-text.jpg
Type: image/jpeg
Size: 14008 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20060722/4f351f3f/attachment.jpg>


More information about the User mailing list