"The code is exactly
how I would like to write code and the algorithms used are very
efficient and well-documented."
Van T. Dinh, Microsoft MVP
|
|
Class: CAPIPrinter
Working with the printer using the Windows API
|
Procedure Name
|
Type
|
Description
|
|
(Declarations)
|
Declarations
|
Declarations and private variables for the CAPIPrinter class
|
|
CurrentX
|
Property
|
Gets the current x position of printer drawing.
|
|
CurrentY
|
Property
|
Gets the current y position of printer drawing.
|
|
Font
|
Property
|
Gets the font used for printing text
|
|
hDC
|
Property
|
Sets the device context of the printer. This property must be set before any drawing code is called.
|
|
Height
|
Property
|
Gets the height of the printer drawing surface.
|
|
PrintJobID
|
Property
|
Gets the ID of the current print job. This property is only valid after the StartDoc method has been called.
|
|
Width
|
Property
|
Gets the width of the printer drawing surface.
|
|
Class_Initialize
|
Initialize
|
Set initial values to defaults which may be overridden with property settings
|
|
Class_Terminate
|
Terminate
|
Make sure the print job is finished
|
|
DrawLine
|
Method
|
Draws a line
|
|
DrawPicture
|
Method
|
Draws a picture.
If the optional parameters lngWidth and lngHeight are not specified, this procedure scales the bitmap to the printer.
|
|
DrawText
|
Method
|
Draws text
|
|
EndDoc
|
Method
|
Ends a print job
|
|
EndPage
|
Method
|
Finish printing a page
|
|
GetTextHeight
|
Method
|
Get the height of the text
|
|
GetTextWidth
|
Method
|
Returns the width of the text.
The font height is measured in logical device units. Most windows API functions for dealing with fonts require the font height in logical units. This function only works correctly in the MM_TEXT mapping mode.
|
|
PointsToHeight
|
Private
|
Converts a font point SIZEAPI to a font height.
The font height is measured in logical device units. Most windows API functions for dealing with fonts require the font height in logical units. This function only works correctly in the MM_TEXT mapping mode.
|
|
ScaleX
|
Method
|
Converts x units between the screen and printer
|
|
ScaleY
|
Method
|
Converts y units between the screen and printer
|
|
StartDoc
|
Method
|
Begins a print job
|
|
StartPage
|
Method
|
Prepares the printer for a new page
|
Overview of Total Visual SourceBook
The source code in Total Visual
SourceBook includes modules and classes for Microsoft Access, Visual
Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily
add this professionally written, tested, and documented royalty-free code
into your applications to simplify your application development efforts.
Additional Resources
|
|