Cor,.. I went to Bobs site as you suggested. His example under imaging is
very close to what I want so I entered his code and tried it (the code
listiong is below). However, the code would not compile. I get the following
error messages..
error 1
C:\_p\TifDisplayProject\TifDisplayProject\Form1.vb (18): Method 'New' has
multiple definitions with identical signatures.
error2
'Sub Main' was not found in 'TifDisplayProject.Form1'.
Also, he is doing a few tricks I don't understand. For example the code..
<STAThread()> _
Shared Sub Main
Application.Run(New Form1())
End Sub
Why is he doing this??
If I can get this example to work, I think I will be OK.
I appreciate your help.
Hamil.
******** Code follows ********
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
Namespace drawimage1
'/ <summary>
'/ Summary description for Form1.
'/ </summary>
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Button1 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(544, 8)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(16, 16)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Button1"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(576, 421)
Me.Controls.Add(Me.Button1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Private MyImage As Image
Public Sub New()
End Sub 'New
'/ <summary>
'/ The main entry point for the application.
'/ </summary>
<STAThread()> _
Shared Sub Main()
Application.Run(New Form1)
End Sub 'Main
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
MyImage = Image.FromFile("C:\temp\Tif1.tif")
MyBase.OnLoad(e)
End Sub 'OnLoad
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
If Not (MyImage Is Nothing) Then
e.Graphics.DrawImage(MyImage, 0, 0)
End If
MyBase.OnPaint(e)
End Sub 'OnPaint
End Class 'Form1
End Namespace 'drawimage1
"Cor Ligthert [MVP]" wrote:
Hamil,
There are a lot of functions, however only the strech does not have impact
on the shape.
If you want to make in smaller keeping the shape the same, than you have to
use the graphic functions for that.
If that is necessary. I cannot see the importancy of this for you
However have a look at that page from Bob, AFAIK has he samples for that.
Cor