Add debugging messages to the Printing example and use full page to print.
[EXAMPLES] * NEW: Add debugging messages to the Printing example and use full page to print.
This commit is contained in:
parent
171c11c523
commit
0f1de30f2a
@ -1,5 +1,4 @@
|
||||
# Gambas Project File 3.0
|
||||
# Compiled with Gambas 3.7.90
|
||||
Title=Printing example
|
||||
Startup=FMain
|
||||
Icon=printer-laser.png
|
||||
@ -11,6 +10,6 @@ Description="Printing example.\n\nThis example shows how to print a text or an i
|
||||
Authors="Benoît Minisini"
|
||||
Environment="GB_GUI=gb.gtk3"
|
||||
TabSize=2
|
||||
Translate=1
|
||||
Vendor=Example
|
||||
Packager=1
|
||||
Translate=1
|
||||
|
@ -37,7 +37,7 @@ Public Sub scrText_Draw()
|
||||
|
||||
Paint.FillRect(0, 0, Draw.W, Draw.H, Color.TextBackground)
|
||||
Try Paint.Font = Font[txtFontText.Text]
|
||||
Paint.Translate(- scrText.ScrollX, - scrText.ScrollY)
|
||||
Paint.Translate(-scrText.ScrollX, -scrText.ScrollY)
|
||||
Paint.Background = Color.TextForeground
|
||||
Paint.DrawRichText(sText, 8, 8, scrText.ClientW - 16, scrText.ClientH - 16, Align.TopNormal)
|
||||
'Debug Paint.ResolutionY;; ":";; Paint.TextSize("toto").Height;; Paint.TextExtents("toto").Height;; "/";; Paint.RichTextSize(sText, scrText.ClientW - 16).Height;; Paint.RichTextExtents(sText, scrText.ClientW - 16).Height
|
||||
@ -108,6 +108,10 @@ Public Sub prtText_Draw()
|
||||
Dim PRINT_MARGIN As Float = Paint.Width / prtText.PaperWidth * 10
|
||||
|
||||
Debug "Printing page";; prtText.Page
|
||||
Debug "Paint.FontScale = "; Paint.FontScale
|
||||
Debug "Paint.Font.Size = "; Paint.Font.Size
|
||||
Debug "Paint.Width = "; Paint.Width
|
||||
Debug "Printer.PaperWidth = "; prtText.PaperWidth
|
||||
|
||||
Paint.Font = Font[txtFontText.Text]
|
||||
Paint.Rectangle(PRINT_MARGIN / 2, PRINT_MARGIN / 2, Paint.Width - PRINT_MARGIN, Paint.Height - PRINT_MARGIN)
|
||||
@ -135,7 +139,7 @@ End
|
||||
|
||||
Public Sub scrImage_Draw()
|
||||
|
||||
If $hImage Then Draw.Image($hImage, - scrImage.ScrollX, - scrImage.ScrollY)
|
||||
If $hImage Then Draw.Image($hImage, -scrImage.ScrollX, -scrImage.ScrollY)
|
||||
|
||||
End
|
||||
|
||||
|
@ -54,6 +54,7 @@
|
||||
}
|
||||
{ prtText #Printer
|
||||
#MoveScaled(62,31)
|
||||
FullPage = True
|
||||
}
|
||||
Index = 1
|
||||
Text = ("Image")
|
||||
|
Loading…
x
Reference in New Issue
Block a user