Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Graphics.WinApplyDevModeMBS(devmode as WindowsDeviceModeMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 12.1 No Yes No No No
Function: Updates the specified printer or plotter device context (graphics) using the specified information.
Notes:
Returns true on success.

This function cannot be used to change the driver name, device name, or the output port. When the user changes the port connection or device name, the application must delete the original graphics and create a new graphics object with the new information.

Windows seems not to allow changing graphics object for printer while a page is open, so use WinEndPageMBS to close page before changing settings.

Does not work for Xojo 2016r4 and newer due to switch to DirectDraw for printing.

Some examples which use this method:

Feedback, Comments & Corrections

Graphics.WindowsGraphicsInfoMBS as WindowsGraphicsInfoMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 12.1 No Yes No No No
Function: Query information about graphics object on Windows.
Notes: Returns nil on any error.

Some examples which use this method:

Feedback, Comments & Corrections

Graphics.WinEndPageMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 12.1 No Yes No No No
Function: The EndPage function notifies the device that the application has finished writing to a page.
Notes:
This function is typically used to direct the device driver to advance to a new page.

Returns true on success.

This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation-factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.

Use the WinApplyDevModeMBS function to change the device mode, if necessary, after calling the EndPage function. Note that a call to WinApplyDevModeMBS resets all device context attributes back to default values. Neither EndPage nor StartPage resets the device context attributes. Device context attributes remain constant across subsequent pages. You do not need to re-select objects and set up the mapping mode again before printing the next page; however, doing so will produce the same results and reduce code differences between versions of Windows.

When a page in a spooled file exceeds approximately 350 MB, it may fail to print and not send an error message. For example, this can occur when printing large EMF files. The page size limit depends on many factors including the amount of virtual memory available, the amount of memory allocated by calling processes, and the amount of fragmentation in the process heap.

Does not work for Xojo 2016r4 and newer due to switch to DirectDraw for printing.

Some examples which use this method:

Feedback, Comments & Corrections

Graphics.WinStartPageMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 12.1 No Yes No No No
Function: The StartPage function prepares the printer driver to accept data.
Notes:
Returns true on success.

This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation-factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.

The system disables the WinApplyDevModeMBS function between calls to the StartPage and EndPage functions. This means that you cannot change the device mode except at page boundaries. After calling EndPage, you can call WinApplyDevModeMBS to change the device mode, if necessary. Note that a call to WinApplyDevModeMBS resets all device context attributes back to default values.

Neither EndPage nor StartPage resets the device context attributes. Device context attributes remain constant across subsequent pages. You do not need to re-select objects and set up the mapping mode again before printing the next page; however, doing so will produce the same results and reduce code differences between versions of Windows.

Does not work for Xojo 2016r4 and newer due to switch to DirectDraw for printing.

Some examples which use this method:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Win Plugin.





Links
MBS Xojo Plugins