<?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_Tutorial%2F2D_Graphics%2FJpeg</id>
		<title>VB.Net Tutorial/2D Graphics/Jpeg - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2F2D_Graphics%2FJpeg"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/2D_Graphics/Jpeg&amp;action=history"/>
		<updated>2026-04-05T07:14:57Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/2D_Graphics/Jpeg&amp;diff=3363&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_Tutorial/2D_Graphics/Jpeg&amp;diff=3363&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:30Z</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_Tutorial/2D_Graphics/Jpeg&amp;diff=3364&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/2D_Graphics/Jpeg&amp;diff=3364&amp;oldid=prev"/>
				<updated>2010-05-26T12:55:10Z</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;==Create Jpeg File==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;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;
   public Shared Sub Main&lt;br /&gt;
        Dim bm As New Bitmap(256, 256)&lt;br /&gt;
        Dim gr As Graphics = Graphics.FromImage(bm)&lt;br /&gt;
        gr.Clear(Color.White)&lt;br /&gt;
        gr.DrawEllipse(Pens.Red, 0, 0, bm.Width - 1, bm.Height - 1)&lt;br /&gt;
        gr.DrawLine(Pens.Green, 0, 0, bm.Width - 1, bm.Height - 1)&lt;br /&gt;
        gr.DrawLine(Pens.Blue, bm.Width - 1, 0, 0, bm.Height - 1)&lt;br /&gt;
        &amp;quot; Save the result as a JPEG file.&lt;br /&gt;
        &lt;br /&gt;
        bm.Save(&amp;quot;test.jpg&amp;quot;, ImageFormat.Jpeg)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get Jpeg Information==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&amp;quot; Quote from&lt;br /&gt;
&amp;quot;Visual Basic 2005 Cookbook Solutions for VB 2005 Programmers&lt;br /&gt;
&amp;quot;by Tim Patrick (Author), John Craig (Author)&lt;br /&gt;
&amp;quot;# Publisher: O&amp;quot;Reilly Media, Inc. (September 21, 2006)&lt;br /&gt;
&amp;quot;# Language: English&lt;br /&gt;
&amp;quot;# ISBN-10: 0596101775&lt;br /&gt;
&amp;quot;# ISBN-13: 978-0596101770&lt;br /&gt;
&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Public Class GetJpgInformation&lt;br /&gt;
    Public Shared Sub Main&lt;br /&gt;
        Console.WriteLine(ProcessJPEG.GetJpgInformation(&amp;quot;yourfile.jpg&amp;quot;))&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Public Class ProcessJPEG&lt;br /&gt;
    Public Shared Function GetJpgInformation(ByVal whichFile As String) As String&lt;br /&gt;
        Dim bytesPropertyID As Byte()&lt;br /&gt;
        Dim stringPropertyID As String&lt;br /&gt;
        Dim loadedImage As System.Drawing.Bitmap&lt;br /&gt;
        Dim propertyIDs() As Integer&lt;br /&gt;
        Dim result As New System.Text.StringBuilder&lt;br /&gt;
        Dim counter As Integer&lt;br /&gt;
        Dim scanProperty As Integer&lt;br /&gt;
        loadedImage = New System.Drawing.Bitmap(whichFile)&lt;br /&gt;
        propertyIDs = loadedImage.PropertyIdList&lt;br /&gt;
        For Each scanProperty In propertyIDs&lt;br /&gt;
            bytesPropertyID = loadedImage.GetPropertyItem(scanProperty).Value&lt;br /&gt;
            stringPropertyID = System.Text.Encoding.ASCII.GetString(bytesPropertyID)&lt;br /&gt;
            For counter = 0 To 255&lt;br /&gt;
                If counter &amp;lt; 32 Or counter &amp;gt; 127 Then&lt;br /&gt;
                    If (stringPropertyID.IndexOf(Chr(counter)) _&lt;br /&gt;
                          &amp;lt;&amp;gt; -1) Then&lt;br /&gt;
                        stringPropertyID = Replace(stringPropertyID, _&lt;br /&gt;
                           Chr(counter), &amp;quot;&amp;quot;)&lt;br /&gt;
                    End If&lt;br /&gt;
                End If&lt;br /&gt;
            Next counter&lt;br /&gt;
            &amp;quot; ----- Display the property if it&amp;quot;s reasonable.&lt;br /&gt;
            If (stringPropertyID.Length &amp;gt; 0) And _&lt;br /&gt;
                  (stringPropertyID.Length &amp;lt; 70) Then&lt;br /&gt;
                result.Append(scanProperty.ToString)&lt;br /&gt;
                result.Append(&amp;quot;:   &amp;quot;)&lt;br /&gt;
                result.AppendLine(stringPropertyID)&lt;br /&gt;
            End If&lt;br /&gt;
        Next scanProperty&lt;br /&gt;
        &amp;quot; ----- Display the results.&lt;br /&gt;
        Return result.ToString&lt;br /&gt;
    End Function&lt;br /&gt;
    Public Shared Function GetString( _&lt;br /&gt;
      ByVal sourceBytes As Byte()) As String&lt;br /&gt;
        &amp;quot; ----- Convert a byte array to a string, taking into&lt;br /&gt;
        &amp;quot;       account the terminating null character.&lt;br /&gt;
        Dim result As String&lt;br /&gt;
        result = System.Text.Encoding.ASCII.GetString(sourceBytes)&lt;br /&gt;
        If (result.EndsWith(vbNullChar) = True) Then _&lt;br /&gt;
           result = result.Substring(0, result.Length - 1)&lt;br /&gt;
        Return result&lt;br /&gt;
    End Function&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==JPEG Compression==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.Drawing.Imaging&lt;br /&gt;
public class MainClass&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Dim curBitmap As Bitmap&lt;br /&gt;
        Dim imgCodecInfo As ImageCodecInfo = Nothing&lt;br /&gt;
        Dim encoder As Encoder&lt;br /&gt;
        Dim encoderParam As EncoderParameter&lt;br /&gt;
        Dim encoderParams As New EncoderParameters(1)&lt;br /&gt;
        curBitmap = New Bitmap(&amp;quot;yourfile.jpg&amp;quot;)&lt;br /&gt;
        Dim j As Integer&lt;br /&gt;
        Dim mimeType As String = &amp;quot;image/jpeg&amp;quot;&lt;br /&gt;
        Dim encoders() As ImageCodecInfo&lt;br /&gt;
        encoders = ImageCodecInfo.GetImageEncoders()&lt;br /&gt;
        j = 0&lt;br /&gt;
        While j &amp;lt; encoders.Length&lt;br /&gt;
            If encoders(j).MimeType = mimeType Then&lt;br /&gt;
                imgCodecInfo = encoders(j)&lt;br /&gt;
            End If&lt;br /&gt;
        End While &amp;quot;&lt;br /&gt;
        encoder = encoder.rupression&lt;br /&gt;
        encoderParam = New EncoderParameter(encoder, 1, CInt(EncoderParameterValueType.ValueTypeLong), 0)&lt;br /&gt;
        encoderParams.Param(0) = encoderParam &amp;quot;&lt;br /&gt;
        curBitmap.Save(&amp;quot;Shape0.jpg&amp;quot;, imgCodecInfo, encoderParams)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>