<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net%2F2D%2FImage</id>
		<title>VB.Net/2D/Image - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net%2F2D%2FImage"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/2D/Image&amp;action=history"/>
		<updated>2026-04-05T00:08:47Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net/2D/Image&amp;diff=92&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/2D/Image&amp;diff=92&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 16:40, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net/2D/Image&amp;diff=93&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/2D/Image&amp;diff=93&amp;oldid=prev"/>
				<updated>2010-05-26T12:41:48Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Convert Image Format==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Public Shared Sub Main()&lt;br /&gt;
        ConvertImage(&amp;quot;sample.gif&amp;quot;, System.Drawing.Imaging.ImageFormat.Bmp, &amp;quot;new.bmp&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Public Shared Sub ConvertImage(ByVal Filename As String, ByVal DesiredFormat As System.Drawing.Imaging.ImageFormat, ByVal NewFilename As String)&lt;br /&gt;
        Try&lt;br /&gt;
            Dim imgFile As System.Drawing.Image = System.Drawing.Image.FromFile(Filename)&lt;br /&gt;
            imgFile.Save(NewFilename, DesiredFormat)&lt;br /&gt;
        Catch ex As Exception&lt;br /&gt;
            Throw ex&lt;br /&gt;
        End Try&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Image Recolor Demo==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Imports System.ruponentModel&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.Configuration&lt;br /&gt;
Imports System.Resources&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Drawing.Imaging&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        Dim myform As Form = New RecoloringForm()&lt;br /&gt;
        Application.Run(myform)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
Public Class RecoloringForm&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
        Me.SetStyle(ControlStyles.ResizeRedraw, True)&lt;br /&gt;
        Me.SetStyle(ControlStyles.DoubleBuffer, True)&lt;br /&gt;
        Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents groupBox2 As System.Windows.Forms.GroupBox&lt;br /&gt;
    Friend WithEvents panel2 As System.Windows.Forms.Panel&lt;br /&gt;
    Friend WithEvents splitter1 As System.Windows.Forms.Splitter&lt;br /&gt;
    Friend WithEvents groupBox1 As System.Windows.Forms.GroupBox&lt;br /&gt;
    Friend WithEvents panel1 As System.Windows.Forms.Panel&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.groupBox2 = New System.Windows.Forms.GroupBox()&lt;br /&gt;
        Me.panel2 = New System.Windows.Forms.Panel()&lt;br /&gt;
        Me.splitter1 = New System.Windows.Forms.Splitter()&lt;br /&gt;
        Me.groupBox1 = New System.Windows.Forms.GroupBox()&lt;br /&gt;
        Me.panel1 = New System.Windows.Forms.Panel()&lt;br /&gt;
        Me.groupBox2.SuspendLayout()&lt;br /&gt;
        Me.groupBox1.SuspendLayout()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;groupBox2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.groupBox2.Controls.AddRange(New System.Windows.Forms.Control() {Me.panel2})&lt;br /&gt;
        Me.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill&lt;br /&gt;
        Me.groupBox2.Location = New System.Drawing.Point(187, 0)&lt;br /&gt;
        Me.groupBox2.Name = &amp;quot;groupBox2&amp;quot;&lt;br /&gt;
        Me.groupBox2.Size = New System.Drawing.Size(205, 182)&lt;br /&gt;
        Me.groupBox2.TabIndex = 5&lt;br /&gt;
        Me.groupBox2.TabStop = False&lt;br /&gt;
        Me.groupBox2.Text = &amp;quot;Mapped Colors&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;panel2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.panel2.BackColor = System.Drawing.Color.White&lt;br /&gt;
        Me.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
        Me.panel2.Dock = System.Windows.Forms.DockStyle.Fill&lt;br /&gt;
        Me.panel2.Location = New System.Drawing.Point(3, 16)&lt;br /&gt;
        Me.panel2.Name = &amp;quot;panel2&amp;quot;&lt;br /&gt;
        Me.panel2.Size = New System.Drawing.Size(199, 163)&lt;br /&gt;
        Me.panel2.TabIndex = 0&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;splitter1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.splitter1.Location = New System.Drawing.Point(184, 0)&lt;br /&gt;
        Me.splitter1.Name = &amp;quot;splitter1&amp;quot;&lt;br /&gt;
        Me.splitter1.Size = New System.Drawing.Size(3, 182)&lt;br /&gt;
        Me.splitter1.TabIndex = 4&lt;br /&gt;
        Me.splitter1.TabStop = False&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;groupBox1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.groupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.panel1})&lt;br /&gt;
        Me.groupBox1.Dock = System.Windows.Forms.DockStyle.Left&lt;br /&gt;
        Me.groupBox1.Name = &amp;quot;groupBox1&amp;quot;&lt;br /&gt;
        Me.groupBox1.Size = New System.Drawing.Size(184, 182)&lt;br /&gt;
        Me.groupBox1.TabIndex = 3&lt;br /&gt;
        Me.groupBox1.TabStop = False&lt;br /&gt;
        Me.groupBox1.Text = &amp;quot;Original Colors&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;panel1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.panel1.BackColor = System.Drawing.Color.White&lt;br /&gt;
        Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
        Me.panel1.Dock = System.Windows.Forms.DockStyle.Fill&lt;br /&gt;
        Me.panel1.Location = New System.Drawing.Point(3, 16)&lt;br /&gt;
        Me.panel1.Name = &amp;quot;panel1&amp;quot;&lt;br /&gt;
        Me.panel1.Size = New System.Drawing.Size(178, 163)&lt;br /&gt;
        Me.panel1.TabIndex = 0&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;RecoloringForm&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(392, 182)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.groupBox2, Me.splitter1, Me.groupBox1})&lt;br /&gt;
        Me.Name = &amp;quot;RecoloringForm&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;RecoloringForm&amp;quot;&lt;br /&gt;
        Me.groupBox2.ResumeLayout(False)&lt;br /&gt;
        Me.groupBox1.ResumeLayout(False)&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Private Sub panel1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles panel1.Paint&lt;br /&gt;
        Dim g As Graphics = e.Graphics&lt;br /&gt;
        Dim bmp As Bitmap = New Bitmap(&amp;quot;figure2.BMP&amp;quot;)&lt;br /&gt;
        Dim rect As Rectangle = New Rectangle(0, 0, bmp.Width, bmp.Height)&lt;br /&gt;
        rect.Offset((Me.panel1.ClientRectangle.Width - rect.Width) / 2, (Me.panel1.ClientRectangle.Height - rect.Height) / 2)&lt;br /&gt;
        g.DrawImage(bmp, rect)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub panel2_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles panel2.Paint&lt;br /&gt;
        Dim g As Graphics = e.Graphics&lt;br /&gt;
        Dim bmp As Bitmap = New Bitmap(&amp;quot;figure2.BMP&amp;quot;)&lt;br /&gt;
        Dim colorMap As ColorMap() = New ColorMap() {New ColorMap()}&lt;br /&gt;
        colorMap(0).OldColor = bmp.GetPixel(0, bmp.Height - 1)&lt;br /&gt;
        colorMap(0).NewColor = Color.White&lt;br /&gt;
        Dim attr As ImageAttributes = New ImageAttributes()&lt;br /&gt;
        attr.SetRemapTable(colorMap)&lt;br /&gt;
        Dim rect As Rectangle = New Rectangle(0, 0, bmp.Width, bmp.Height)&lt;br /&gt;
        rect.Offset((Me.panel2.ClientRectangle.Width - rect.Width) / 2, (Me.panel2.ClientRectangle.Height - rect.Height) / 2)&lt;br /&gt;
        g.DrawImage(bmp, rect, 0, 0, rect.Width, rect.Height, g.PageUnit, attr)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Image Scale Clip Form==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Imports System.ruponentModel&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.Configuration&lt;br /&gt;
Imports System.Resources&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Drawing.Imaging&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        Dim myform As Form = New ScalingClippingForm()&lt;br /&gt;
        Application.Run(myform)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
Public Class ScalingClippingForm&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
        Me.SetStyle(ControlStyles.ResizeRedraw, True)&lt;br /&gt;
        Me.SetStyle(ControlStyles.DoubleBuffer, True)&lt;br /&gt;
        Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents splitter1 As System.Windows.Forms.Splitter&lt;br /&gt;
    Friend WithEvents groupBox1 As System.Windows.Forms.GroupBox&lt;br /&gt;
    Friend WithEvents panel1 As System.Windows.Forms.Panel&lt;br /&gt;
    Friend WithEvents groupBox2 As System.Windows.Forms.GroupBox&lt;br /&gt;
    Friend WithEvents panel2 As System.Windows.Forms.Panel&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.splitter1 = New System.Windows.Forms.Splitter()&lt;br /&gt;
        Me.groupBox1 = New System.Windows.Forms.GroupBox()&lt;br /&gt;
        Me.panel1 = New System.Windows.Forms.Panel()&lt;br /&gt;
        Me.groupBox2 = New System.Windows.Forms.GroupBox()&lt;br /&gt;
        Me.panel2 = New System.Windows.Forms.Panel()&lt;br /&gt;
        Me.groupBox1.SuspendLayout()&lt;br /&gt;
        Me.groupBox2.SuspendLayout()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;splitter1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.splitter1.Location = New System.Drawing.Point(184, 0)&lt;br /&gt;
        Me.splitter1.Name = &amp;quot;splitter1&amp;quot;&lt;br /&gt;
        Me.splitter1.Size = New System.Drawing.Size(3, 182)&lt;br /&gt;
        Me.splitter1.TabIndex = 4&lt;br /&gt;
        Me.splitter1.TabStop = False&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;groupBox1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.groupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.panel1})&lt;br /&gt;
        Me.groupBox1.Dock = System.Windows.Forms.DockStyle.Left&lt;br /&gt;
        Me.groupBox1.Name = &amp;quot;groupBox1&amp;quot;&lt;br /&gt;
        Me.groupBox1.Size = New System.Drawing.Size(184, 182)&lt;br /&gt;
        Me.groupBox1.TabIndex = 3&lt;br /&gt;
        Me.groupBox1.TabStop = False&lt;br /&gt;
        Me.groupBox1.Text = &amp;quot;Scaling&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;panel1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.panel1.BackColor = System.Drawing.Color.White&lt;br /&gt;
        Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
        Me.panel1.Dock = System.Windows.Forms.DockStyle.Fill&lt;br /&gt;
        Me.panel1.Location = New System.Drawing.Point(3, 16)&lt;br /&gt;
        Me.panel1.Name = &amp;quot;panel1&amp;quot;&lt;br /&gt;
        Me.panel1.Size = New System.Drawing.Size(178, 163)&lt;br /&gt;
        Me.panel1.TabIndex = 0&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;groupBox2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.groupBox2.Controls.AddRange(New System.Windows.Forms.Control() {Me.panel2})&lt;br /&gt;
        Me.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill&lt;br /&gt;
        Me.groupBox2.Name = &amp;quot;groupBox2&amp;quot;&lt;br /&gt;
        Me.groupBox2.Size = New System.Drawing.Size(392, 182)&lt;br /&gt;
        Me.groupBox2.TabIndex = 5&lt;br /&gt;
        Me.groupBox2.TabStop = False&lt;br /&gt;
        Me.groupBox2.Text = &amp;quot;Clipping&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;panel2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.panel2.BackColor = System.Drawing.Color.White&lt;br /&gt;
        Me.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
        Me.panel2.Dock = System.Windows.Forms.DockStyle.Fill&lt;br /&gt;
        Me.panel2.Location = New System.Drawing.Point(3, 16)&lt;br /&gt;
        Me.panel2.Name = &amp;quot;panel2&amp;quot;&lt;br /&gt;
        Me.panel2.Size = New System.Drawing.Size(386, 163)&lt;br /&gt;
        Me.panel2.TabIndex = 0&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;ScalingClippingForm&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(392, 182)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.splitter1, Me.groupBox1, Me.groupBox2})&lt;br /&gt;
        Me.Name = &amp;quot;ScalingClippingForm&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;ScalingClippingFor&amp;quot;&lt;br /&gt;
        Me.groupBox1.ResumeLayout(False)&lt;br /&gt;
        Me.groupBox2.ResumeLayout(False)&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
&lt;br /&gt;
    Private Sub panel1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles panel1.Paint&lt;br /&gt;
        Dim g As Graphics = e.Graphics&lt;br /&gt;
        Dim bmp As Bitmap = New Bitmap(&amp;quot;figure2.bmp&amp;quot;)&lt;br /&gt;
        Dim rect As Rectangle = New Rectangle(10, 10, Me.panel1.ClientRectangle.Width - 20, Me.panel1.ClientRectangle.Height - 20)&lt;br /&gt;
        g.DrawImage(bmp, rect)&lt;br /&gt;
        g.DrawRectangle(Pens.Black, rect)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub panel2_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles panel2.Paint&lt;br /&gt;
        Dim g As Graphics = e.Graphics&lt;br /&gt;
        Dim bmp As Bitmap = New Bitmap(&amp;quot;figure2.bmp&amp;quot;)&lt;br /&gt;
        Dim destRect As Rectangle = New Rectangle(10, 10, Me.panel2.ClientRectangle.Width - 20, Me.panel2.ClientRectangle.Height - 20)&lt;br /&gt;
        Dim srcRect As Rectangle = New Rectangle(0, 0, destRect.Width, destRect.Height)&lt;br /&gt;
        g.DrawImage(bmp, destRect, srcRect, g.PageUnit)&lt;br /&gt;
        g.DrawRectangle(Pens.Black, destRect)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Image Skew Demo==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Imports System.ruponentModel&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.Configuration&lt;br /&gt;
Imports System.Resources&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Drawing.Imaging&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        Dim myform As Form = New SkewingForm()&lt;br /&gt;
        Application.Run(myform)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
Public Class SkewingForm&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents upButton As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents panel1 As System.Windows.Forms.Panel&lt;br /&gt;
    Friend WithEvents downButton As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents leftButton As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents rightButton As System.Windows.Forms.Button&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.upButton = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.panel1 = New System.Windows.Forms.Panel()&lt;br /&gt;
        Me.downButton = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.leftButton = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.rightButton = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;upButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.upButton.Anchor = System.Windows.Forms.AnchorStyles.Top&lt;br /&gt;
        Me.upButton.Location = New System.Drawing.Point(132, 10)&lt;br /&gt;
        Me.upButton.Name = &amp;quot;upButton&amp;quot;&lt;br /&gt;
        Me.upButton.Size = New System.Drawing.Size(24, 23)&lt;br /&gt;
        Me.upButton.TabIndex = 5&lt;br /&gt;
        Me.upButton.Text = &amp;quot;^&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;panel1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.panel1.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _&lt;br /&gt;
                    Or System.Windows.Forms.AnchorStyles.Left) _&lt;br /&gt;
                    Or System.Windows.Forms.AnchorStyles.Right)&lt;br /&gt;
        Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle&lt;br /&gt;
        Me.panel1.Location = New System.Drawing.Point(36, 43)&lt;br /&gt;
        Me.panel1.Name = &amp;quot;panel1&amp;quot;&lt;br /&gt;
        Me.panel1.Size = New System.Drawing.Size(216, 184)&lt;br /&gt;
        Me.panel1.TabIndex = 2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;downButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.downButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom&lt;br /&gt;
        Me.downButton.Location = New System.Drawing.Point(132, 234)&lt;br /&gt;
        Me.downButton.Name = &amp;quot;downButton&amp;quot;&lt;br /&gt;
        Me.downButton.Size = New System.Drawing.Size(24, 23)&lt;br /&gt;
        Me.downButton.TabIndex = 6&lt;br /&gt;
        Me.downButton.Text = &amp;quot;v&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;leftButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.leftButton.Anchor = System.Windows.Forms.AnchorStyles.Left&lt;br /&gt;
        Me.leftButton.Location = New System.Drawing.Point(6, 124)&lt;br /&gt;
        Me.leftButton.Name = &amp;quot;leftButton&amp;quot;&lt;br /&gt;
        Me.leftButton.Size = New System.Drawing.Size(24, 23)&lt;br /&gt;
        Me.leftButton.TabIndex = 3&lt;br /&gt;
        Me.leftButton.Text = &amp;quot;&amp;lt;&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;rightButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.rightButton.Anchor = System.Windows.Forms.AnchorStyles.Right&lt;br /&gt;
        Me.rightButton.Location = New System.Drawing.Point(262, 124)&lt;br /&gt;
        Me.rightButton.Name = &amp;quot;rightButton&amp;quot;&lt;br /&gt;
        Me.rightButton.Size = New System.Drawing.Size(24, 23)&lt;br /&gt;
        Me.rightButton.TabIndex = 4&lt;br /&gt;
        Me.rightButton.Text = &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;SkewingForm&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 266)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.upButton, Me.panel1, Me.downButton, Me.leftButton, Me.rightButton})&lt;br /&gt;
        Me.Name = &amp;quot;SkewingForm&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;SkewingForm&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Dim bmp As Bitmap = New Bitmap(&amp;quot;figure2.bmp&amp;quot;)&lt;br /&gt;
    Dim offset As Size = New Size(0, 0)&lt;br /&gt;
    Private Sub panel1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles panel1.Paint&lt;br /&gt;
        Dim g As Graphics = e.Graphics&lt;br /&gt;
        Dim rect As Rectangle = Me.panel1.ClientRectangle&lt;br /&gt;
        Dim points As Point() = New Point() { _&lt;br /&gt;
            New Point(rect.Left + offset.Width, rect.Top + offset.Height), _&lt;br /&gt;
            New Point(rect.Right, rect.Top + offset.Height), _&lt;br /&gt;
            New Point(rect.Left, rect.Bottom - offset.Height)}&lt;br /&gt;
        g.DrawImage(bmp, points)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub upButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles upButton.Click&lt;br /&gt;
        offset.Height = offset.Height + 10&lt;br /&gt;
        panel1.Refresh()&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub leftButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles leftButton.Click&lt;br /&gt;
        offset.Width = offset.Width - 10&lt;br /&gt;
        panel1.Refresh()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub downButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles downButton.Click&lt;br /&gt;
        offset.Height = offset.Height - 10&lt;br /&gt;
        panel1.Refresh()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub rightButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rightButton.Click&lt;br /&gt;
        offset.Width = offset.Width + 10&lt;br /&gt;
        panel1.Refresh()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Move an Image==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Imports System.ruponentModel&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.Configuration&lt;br /&gt;
Imports System.Resources&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Drawing.Imaging&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        Dim myform As Form = New PanningForm()&lt;br /&gt;
        Application.Run(myform)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
Public Class PanningForm&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents upButton As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents panel1 As System.Windows.Forms.Panel&lt;br /&gt;
    Friend WithEvents downButton As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents leftButton As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents rightButton As System.Windows.Forms.Button&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.upButton = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.panel1 = New System.Windows.Forms.Panel()&lt;br /&gt;
        Me.downButton = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.leftButton = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.rightButton = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;upButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.upButton.Anchor = System.Windows.Forms.AnchorStyles.Top&lt;br /&gt;
        Me.upButton.Location = New System.Drawing.Point(132, 10)&lt;br /&gt;
        Me.upButton.Name = &amp;quot;upButton&amp;quot;&lt;br /&gt;
        Me.upButton.Size = New System.Drawing.Size(24, 23)&lt;br /&gt;
        Me.upButton.TabIndex = 5&lt;br /&gt;
        Me.upButton.Text = &amp;quot;^&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;panel1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.panel1.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _&lt;br /&gt;
                    Or System.Windows.Forms.AnchorStyles.Left) _&lt;br /&gt;
                    Or System.Windows.Forms.AnchorStyles.Right)&lt;br /&gt;
        Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle&lt;br /&gt;
        Me.panel1.Location = New System.Drawing.Point(36, 43)&lt;br /&gt;
        Me.panel1.Name = &amp;quot;panel1&amp;quot;&lt;br /&gt;
        Me.panel1.Size = New System.Drawing.Size(216, 184)&lt;br /&gt;
        Me.panel1.TabIndex = 2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;downButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.downButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom&lt;br /&gt;
        Me.downButton.Location = New System.Drawing.Point(132, 234)&lt;br /&gt;
        Me.downButton.Name = &amp;quot;downButton&amp;quot;&lt;br /&gt;
        Me.downButton.Size = New System.Drawing.Size(24, 23)&lt;br /&gt;
        Me.downButton.TabIndex = 6&lt;br /&gt;
        Me.downButton.Text = &amp;quot;v&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;leftButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.leftButton.Anchor = System.Windows.Forms.AnchorStyles.Left&lt;br /&gt;
        Me.leftButton.Location = New System.Drawing.Point(6, 124)&lt;br /&gt;
        Me.leftButton.Name = &amp;quot;leftButton&amp;quot;&lt;br /&gt;
        Me.leftButton.Size = New System.Drawing.Size(24, 23)&lt;br /&gt;
        Me.leftButton.TabIndex = 3&lt;br /&gt;
        Me.leftButton.Text = &amp;quot;&amp;lt;&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;rightButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.rightButton.Anchor = System.Windows.Forms.AnchorStyles.Right&lt;br /&gt;
        Me.rightButton.Location = New System.Drawing.Point(262, 124)&lt;br /&gt;
        Me.rightButton.Name = &amp;quot;rightButton&amp;quot;&lt;br /&gt;
        Me.rightButton.Size = New System.Drawing.Size(24, 23)&lt;br /&gt;
        Me.rightButton.TabIndex = 4&lt;br /&gt;
        Me.rightButton.Text = &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;PanningForm&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 266)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.upButton, Me.panel1, Me.downButton, Me.leftButton, Me.rightButton})&lt;br /&gt;
        Me.Name = &amp;quot;PanningForm&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;PanningForm&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Dim bmp As Bitmap = New Bitmap(&amp;quot;figure2.bmp&amp;quot;)&lt;br /&gt;
    Dim offset As Size = New Size(0, 0)&lt;br /&gt;
    Private Sub panel1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles panel1.Paint&lt;br /&gt;
        Dim g As Graphics = e.Graphics&lt;br /&gt;
        Dim destRect As Rectangle = Me.panel1.ClientRectangle&lt;br /&gt;
        Dim srcRect As Rectangle = New Rectangle(offset.Width, offset.Height, destRect.Width, destRect.Height)&lt;br /&gt;
        g.DrawImage(bmp, destRect, srcRect, g.PageUnit)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub upButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles upButton.Click&lt;br /&gt;
        offset.Height = offset.Height + 10&lt;br /&gt;
        panel1.Refresh()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub downButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles downButton.Click&lt;br /&gt;
        offset.Height = offset.Height - 10&lt;br /&gt;
        panel1.Refresh()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub rightButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rightButton.Click&lt;br /&gt;
        offset.Width = offset.Width + 10&lt;br /&gt;
        panel1.Refresh()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub leftButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles leftButton.Click&lt;br /&gt;
        offset.Width = offset.Width - 10&lt;br /&gt;
        panel1.Refresh()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Print Image==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.IO&lt;br /&gt;
Imports System.Xml.Serialization&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Drawing.Text&lt;br /&gt;
Imports System.Drawing.Printing&lt;br /&gt;
&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
       &lt;br /&gt;
       Dim form1 As Form = New Form1()&lt;br /&gt;
       Application.Run(form1) &lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Public Class Form1&lt;br /&gt;
  Inherits System.Windows.Forms.Form&lt;br /&gt;
  Private MyImage As Image&lt;br /&gt;
  Private pd As PrintDocument&lt;br /&gt;
  Private Preview As PrintPreviewDialog&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
  Public Sub New()&lt;br /&gt;
    MyBase.New()&lt;br /&gt;
    InitializeComponent()&lt;br /&gt;
    MyImage = Bitmap.FromFile(&amp;quot;figure2.bmp&amp;quot;)&lt;br /&gt;
    Preview = New PrintPreviewDialog()&lt;br /&gt;
    Preview.UseAntiAlias = True&lt;br /&gt;
  End Sub&lt;br /&gt;
  &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
  Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
    If disposing Then&lt;br /&gt;
      If Not (components Is Nothing) Then&lt;br /&gt;
        components.Dispose()&lt;br /&gt;
      End If&lt;br /&gt;
    End If&lt;br /&gt;
    MyBase.Dispose(disposing)&lt;br /&gt;
  End Sub&lt;br /&gt;
  &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
  Private components As System.ruponentModel.IContainer&lt;br /&gt;
  &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
  &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
  &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
  Friend WithEvents lblPrint As System.Windows.Forms.Label&lt;br /&gt;
  Friend WithEvents cmdShow As System.Windows.Forms.Button&lt;br /&gt;
  &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
    Me.lblPrint = New System.Windows.Forms.Label()&lt;br /&gt;
    Me.cmdShow = New System.Windows.Forms.Button()&lt;br /&gt;
    Me.SuspendLayout()&lt;br /&gt;
    &amp;quot;&lt;br /&gt;
    &amp;quot;lblPrint&lt;br /&gt;
    &amp;quot;&lt;br /&gt;
    Me.lblPrint.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
    Me.lblPrint.Location = New System.Drawing.Point(152, 16)&lt;br /&gt;
    Me.lblPrint.Name = &amp;quot;lblPrint&amp;quot;&lt;br /&gt;
    Me.lblPrint.Size = New System.Drawing.Size(280, 136)&lt;br /&gt;
    Me.lblPrint.TabIndex = 3&lt;br /&gt;
    &amp;quot;&lt;br /&gt;
    &amp;quot;cmdShow&lt;br /&gt;
    &amp;quot;&lt;br /&gt;
    Me.cmdShow.Location = New System.Drawing.Point(360, 328)&lt;br /&gt;
    Me.cmdShow.Name = &amp;quot;cmdShow&amp;quot;&lt;br /&gt;
    Me.cmdShow.Size = New System.Drawing.Size(72, 24)&lt;br /&gt;
    Me.cmdShow.TabIndex = 2&lt;br /&gt;
    Me.cmdShow.Text = &amp;quot;Show&amp;quot;&lt;br /&gt;
    &amp;quot;&lt;br /&gt;
    &amp;quot;Form1&lt;br /&gt;
    &amp;quot;&lt;br /&gt;
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
    Me.ClientSize = New System.Drawing.Size(442, 373)&lt;br /&gt;
    Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.lblPrint, Me.cmdShow})&lt;br /&gt;
    Me.MaximizeBox = False&lt;br /&gt;
    Me.MinimizeBox = False&lt;br /&gt;
    Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
    Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen&lt;br /&gt;
    Me.Text = &amp;quot;Form1&amp;quot;&lt;br /&gt;
    Me.ResumeLayout(False)&lt;br /&gt;
  End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
&lt;br /&gt;
  Private Sub Form1_Load(ByVal sender As System.Object, _&lt;br /&gt;
                         ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
    pd = New PrintDocument()&lt;br /&gt;
    AddHandler pd.PrintPage, New PrintPageEventHandler(AddressOf Me.pd_Print)&lt;br /&gt;
    Preview.Document = pd&lt;br /&gt;
  End Sub&lt;br /&gt;
  Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)&lt;br /&gt;
    DrawIt(e.Graphics)&lt;br /&gt;
  End Sub&lt;br /&gt;
  Private Sub pd_Print(ByVal sender As Object, ByVal e As PrintPageEventArgs)&lt;br /&gt;
    lblPrint.Text += sender.ToString() &lt;br /&gt;
    DrawIt(e.Graphics)&lt;br /&gt;
  End Sub&lt;br /&gt;
  Private Sub DrawIt(ByVal G As Graphics)&lt;br /&gt;
    G.SmoothingMode = SmoothingMode.AntiAlias&lt;br /&gt;
    G.DrawImage(MyImage, 10, 10)&lt;br /&gt;
  End Sub&lt;br /&gt;
  Private Sub cmdShow_Click(ByVal sender As System.Object, _&lt;br /&gt;
                            ByVal e As System.EventArgs) Handles cmdShow.Click&lt;br /&gt;
    Preview.WindowState = FormWindowState.Maximized&lt;br /&gt;
    pd.DocumentName = DateTime.Now.Ticks.ToString()&lt;br /&gt;
    Preview.ShowDialog()&lt;br /&gt;
  End Sub&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>