The Ctrl + V Game

DeoNaught

I'm here to steal memes and break dreams
Member
Joined
Aug 22, 2016
Messages
2,261
Trophies
0
Location
Constant Fear
Website
Gbatemp.net
XP
2,237
Country
United States
Code:
    Private Sub PrintDocument1_PrintPage(sender As Object, e As PrintPageEventArgs) Handles PrintDocument1.PrintPage
        ' Create a rectangle the size of the printable area of the page.
        Dim recPrintable As New Rectangle(
            e.MarginBounds.Left, e.MarginBounds.Top,
            e.MarginBounds.Width, e.MarginBounds.Height)

        ' Create a rectangle used for the actual drawing dimensions of the image.
        ' Default it to the printable area.
        Dim recDraw As Rectangle = recPrintable

        ' Load the image in a bitmap object we can use.
        Dim bmSource As New Bitmap(ofdSelectPicture.FileName)

        ResizeToPrintableArea(bmSource, recDraw, recPrintable)

        ' Draw the bitmap on the Graphics object of the PrintDocument control.
        e.Graphics.DrawImage(bmSource, recDraw)

        ' This is the last page to be printed.
        e.HasMorePages = False

        ' Free up resources used.
        bmSource.Dispose()

    End Sub
 
  • Like
Reactions: ThoD and Seriel

Seriel

Doing her best
Member
Joined
Aug 18, 2015
Messages
3,285
Trophies
3
Age
23
Location
UK
XP
5,432
Country
United Kingdom
caea41.png
 
  • Like
Reactions: ThoD and smileyhead
General chit-chat
Help Users
    Skelletonike @ Skelletonike: alright, accepted +1