bug with printer example
Posted: Tue Oct 15, 2019 4:30 pm
I'm a new user, and I'm using PureBasic to do some printing. This example code works fine:
However, if I remove the lines that load and print the image, the compile crashes with:
I can leave the code in and comment out the DrawImage() statement, and it works fine.
Rich Dersheimer
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - Printer example file
;
; (c) Fantaisie Software
;
; ------------------------------------------------------------
;
If PrintRequester()
If StartPrinting("PureBasic Test")
LoadFont(0, "Arial", 30)
LoadFont(1, "Arial", 100)
If StartDrawing(PrinterOutput())
BackColor(RGB(255, 255, 255)) ; Uses white as back color, usuful when printing on a white sheet
FrontColor(RGB(0, 0, 0)) ; Use black for standard text color
DrawingFont(FontID(0))
DrawText(100, 100, "PureBasic Printer Test")
DrawingFont(FontID(1))
DrawText(100, 400, "PureBasic Printer Test 2")
If LoadImage(0, #PB_Compiler_Home + "examples/sources/Data/PureBasic.bmp")
DrawImage(ImageID(0), 200, 600)
Else
MessageRequester("Error","Can't load the image")
EndIf
Box(200, 1000, 100, 100, RGB(255, 0, 0)) ; Draw a red box
StopDrawing()
EndIf
StopPrinting()
EndIf
EndIfCode: Select all
[10:24:10] Waiting for executable to start...
[10:24:10] Executable type: Windows - x64 (64bit, Unicode)
[10:24:10] Executable started.
[10:24:16] The debugged executable quit unexpectedly.
Rich Dersheimer