Hi Prashant,
Thanks for the link, i think it's just what i'm after. I should now mention that i'm a bit (well maybe a lot) of a novice with programming so my next question may strike you as a bit stupid but please bear wth me if you will.
After reading thro the post i came up with this:
Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim ImgX = Me.bxImageView.Image.Height
Dim ImgY = Me.bxImageView.Image.Width
Dim PSizeX = Me.PrintDocument1.DefaultPageSettings.PaperSize.Height
Dim PSizeY = Me.PrintDocument1.DefaultPageSettings.PaperSize.Width
Dim ScaleX = PSizeX / ImgX
Dim ScaleY = PSizeY / ImgY
e.Graphics.DrawImage(bxImageView.Image, ScaleX, ScaleY)
End Sub
which, as you will see is in the event handler and i'm coming up with this error when i try to run the process.
************** Exception Text **************
System.Reflection.AmbiguousMatchException: No accessible overloaded 'Graphics.DrawImage' can be called with these arguments without a narrowing conversion:
Public Sub DrawImage ( ByVal image As System.Drawing.Image, ByVal x As Single, ByVal y As Single )
Public Sub DrawImage ( ByVal image As System.Drawing.Image, ByVal x As Integer, ByVal y As Integer )
at System.Windows.Forms.PrintPreviewControl.CalculatePageInfo()
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
AddrdessAppNav
Assembly Version: 1.0.2460.14745
Win32 Version: 1.0.2460.14745
CodeBase: file:///C:/Documents%20and%20Settings/Administrator/My%20Documents/Visual%20Studio%20Projects/AddrdessAppNav/bin/AddrdessAppNav.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 7.0.5000.0
What does it all mean? Am i implementing the code in the wrong place?
Many thanks,
Noel.