[Gambas-user] Printer code request

Fabien Bodard gambas.fr at ...626...
Sat Aug 11 14:35:59 CEST 2012


And how to print a screenshot with gb.report:

the code :

Public Sub Button1_Click()

  Dim hImg As Image
  Dim hReport As New Report
  Dim hReportLabel As New ReportLabel(hreport)
  Dim hRepImg As New ReportImage(hReport)

  hreport.Orientation = Printer.Landscape
  hreport.Padding = ReportPadding["2 cm"]
  hReport.Spacing = "1 cm"

  hImg = Desktop.Screenshot().Image

  hReportLabel.Text = "MyScreenSHot"
  hReportLabel.Autoresize = True
  hReportLabel.Alignment = Align.Center
  hReportLabel.Font.Size = 24

  hRepImg.Image = hImg
  hRepImg.Autoresize = True
  hRepImg.Stretch = Report.Proportional
  hRepImg.Expand = True
 hReport.Preview

End


Well i can do more short (no formating)

dim hImg as new reportimage(report)
hImg.Image = desktop.screenshot()
himg.strech=report.proportional
himg.expand=true
report.preview()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: report_screenshot-0.0.1.tar.gz
Type: application/x-gzip
Size: 4891 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20120811/61b6b93a/attachment.bin>


More information about the User mailing list