Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitlePrint a multi-page picture
Keywordsprint, big picture, large picture
CategoriesGraphics
 
Make a routine that draws the picture at full scale. For each page, set the Printer object's ScaleLeft, ScaleTop, ScaleWidth, and ScaleHeight properties to print the desired area.
 
' Draw a big picture on the object.
Private Sub DrawPicture(ByVal obj As Object)
Const PI = 3.14159265

    obj.FillStyle = vbFSTransparent
    obj.Circle (8.5 * 1440, 11 * 1440), 8 * 1440
    obj.Circle (8.5 * 1440, 12 * 1440), 2 * 1440, , , , 1.5
    obj.Circle (8.5 * 1440, 11 * 1440), 6 * 1440, , PI, _
        1.99 * PI
    obj.Circle (12.5 * 1440, 8 * 1440), 1.5 * 1440
    obj.Circle (4.5 * 1440, 8 * 1440), 1.5 * 1440
    obj.FillStyle = vbFSSolid
    obj.Circle ((12.5 + 0.75) * 1440, 8 * 1440), 0.75 * 1440
    obj.Circle ((4.5 + 0.75) * 1440, 8 * 1440), 0.75 * 1440
End Sub

' Print the picture on four pages.
Private Sub cmdPrint_Click()
Const PAGE_WIDTH = 8.5 * 1440
Const PAGE_HEIGHT = 11 * 1440

Dim R As Integer
Dim C As Integer

    For R = 0 To 1
        For C = 0 To 1
            With Printer
                .ScaleLeft = R * PAGE_WIDTH
                .ScaleTop = C * PAGE_HEIGHT
                .ScaleWidth = PAGE_WIDTH
                .ScaleHeight = PAGE_HEIGHT
            End With

            DrawPicture Printer
            Printer.NewPage
        Next C
    Next R
    Printer.EndDoc

    MsgBox "Ok"
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated