paint.end

Post

Posted
Rating:
#1 (In Topic #364)
Avatar
Enthusiast
sadams54 is in the usergroup ‘Enthusiast’
 With the latest update many things changed and no backward compatibility was considered. I have fixed my printing problems with the help of benoit, but one remains.
In the past it worked fine. I set the number of pages for the document in the begin method. The it called the draw as many times as there are pages. each time you end the page with a paint.end command. Problem is now this works for a single page no issue. It crashes on subsequent pages with the error "No current device" on the first command to try to use the paint object. Something has changed. What is the new method to end a page and start the next?
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Enthusiast
GrayGhost is in the usergroup ‘Enthusiast’
give this a try , it should print three pages :

Code (gambas)

  1. Public Sub PrintButton_Click()
  2.  
  3.   If Printer2.Configure() Then Return
  4.   Printer2.Count = 3
  5.   Me.Enabled = False
  6.   Printer2.Print
  7.   Me.Enabled = True
  8.  
  9.  
  10. Public Sub Printer2_Draw()
  11.  Paint.DrawRichText("hello", 300, 300)
  12.  Paint.DrawRichText("page # " & Printer2.page, 400, 600)
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Enthusiast
sadams54 is in the usergroup ‘Enthusiast’
 Hey, thanks so much. Your answer was a bit wordy but that did the trick.

You could simplify the answer for others by just saying to eliminate the paint.end command and it all works.

Looks like the paint.end command is no longer needed.

Thanks again for the help.
Online now: No Back to the top
1 guest and 0 members have just viewed this.