<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FGUI_Windows_Forms%2FPictureBox</id>
		<title>Csharp/CSharp Tutorial/GUI Windows Forms/PictureBox - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FGUI_Windows_Forms%2FPictureBox"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/PictureBox&amp;action=history"/>
		<updated>2026-04-30T02:21:08Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/PictureBox&amp;diff=5369&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/PictureBox&amp;diff=5369&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</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;Версия 15:31, 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://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/PictureBox&amp;diff=5370&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/PictureBox&amp;diff=5370&amp;oldid=prev"/>
				<updated>2010-05-26T12:15:09Z</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;==Add Image to PictureBox==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
public class PictureBoxImageAdding : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  private System.ruponentModel.Container components = null;&lt;br /&gt;
  private PictureBox picBox = new PictureBox();&lt;br /&gt;
  public PictureBoxImageAdding()&lt;br /&gt;
  {&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
    picBox.SizeMode = PictureBoxSizeMode.StretchImage;&lt;br /&gt;
    picBox.Location = new System.Drawing.Point(64, 32);&lt;br /&gt;
    picBox.Size = new System.Drawing.Size(50, 50);&lt;br /&gt;
    picBox.Image = new Bitmap(&amp;quot;yourFile.bmp&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    Controls.Add(picBox);&lt;br /&gt;
  }&lt;br /&gt;
  protected override void Dispose( bool disposing )&lt;br /&gt;
  {&lt;br /&gt;
    picBox.Dispose();&lt;br /&gt;
    if( disposing )&lt;br /&gt;
    {&lt;br /&gt;
      if (components != null) &lt;br /&gt;
      {&lt;br /&gt;
        components.Dispose();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    base.Dispose( disposing );&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private void InitializeComponent()&lt;br /&gt;
  {&lt;br /&gt;
    this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
    this.ClientSize = new System.Drawing.Size(292, 273);&lt;br /&gt;
  }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new PictureBoxImageAdding());&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==AutoSize PictureBox==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class PictureBoxAutoSize : Form&lt;br /&gt;
{&lt;br /&gt;
  public PictureBoxAutoSize()&lt;br /&gt;
  {&lt;br /&gt;
    Size = new Size(550,500);&lt;br /&gt;
    AutoScroll = true;&lt;br /&gt;
    Image img = Image.FromFile(&amp;quot;YourFile.bmp&amp;quot;);&lt;br /&gt;
    Label lblAuto = new Label();&lt;br /&gt;
    lblAuto.Parent = this;&lt;br /&gt;
    lblAuto.Location = new Point(0, 250);&lt;br /&gt;
    lblAuto.Size = new Size(75,25);&lt;br /&gt;
    lblAuto.TextAlign = ContentAlignment.MiddleRight;&lt;br /&gt;
    lblAuto.Text = &amp;quot;AutoSize:&amp;quot;;&lt;br /&gt;
    PictureBox pbAutoBig = new PictureBox();&lt;br /&gt;
    pbAutoBig.Parent = this;&lt;br /&gt;
    pbAutoBig.Size = new Size(200, 200);&lt;br /&gt;
    pbAutoBig.Location = new Point(75, 250);&lt;br /&gt;
    pbAutoBig.BorderStyle = BorderStyle.FixedSingle;&lt;br /&gt;
    pbAutoBig.SizeMode = PictureBoxSizeMode.AutoSize;&lt;br /&gt;
    pbAutoBig.Image = img;&lt;br /&gt;
  }&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new PictureBoxAutoSize());&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CenterImage PictureBox==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class PictureBoxCenterImage : Form&lt;br /&gt;
{&lt;br /&gt;
  public PictureBoxCenterImage()&lt;br /&gt;
  {&lt;br /&gt;
    Size = new Size(550,500);&lt;br /&gt;
    AutoScroll = true;&lt;br /&gt;
    Image img = Image.FromFile(&amp;quot;YourFile.bmp&amp;quot;);&lt;br /&gt;
    Label lblCenter = new Label();&lt;br /&gt;
    lblCenter.Parent = this;&lt;br /&gt;
    lblCenter.Location = new Point(0,480);&lt;br /&gt;
    lblCenter.Size = new Size(75,25);&lt;br /&gt;
    lblCenter.TextAlign = ContentAlignment.MiddleRight;&lt;br /&gt;
    lblCenter.Text = &amp;quot;CenterImage:&amp;quot;;&lt;br /&gt;
    PictureBox pbCenterBig = new PictureBox();&lt;br /&gt;
    pbCenterBig.Parent = this;&lt;br /&gt;
    pbCenterBig.Size = new Size(200, 200);&lt;br /&gt;
    pbCenterBig.Location = new Point(75,480);&lt;br /&gt;
    pbCenterBig.BorderStyle = BorderStyle.FixedSingle;&lt;br /&gt;
    pbCenterBig.SizeMode = PictureBoxSizeMode.CenterImage;&lt;br /&gt;
    pbCenterBig.Image = img;&lt;br /&gt;
    PictureBox pbCenterSmall = new PictureBox();&lt;br /&gt;
    pbCenterSmall.Parent = this;&lt;br /&gt;
    pbCenterSmall.Size = new Size(100, 100);&lt;br /&gt;
    pbCenterSmall.Location = new Point(325,480);&lt;br /&gt;
    pbCenterSmall.BorderStyle = BorderStyle.FixedSingle;&lt;br /&gt;
    pbCenterSmall.SizeMode = PictureBoxSizeMode.CenterImage;&lt;br /&gt;
    pbCenterSmall.Image = img;&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new PictureBoxCenterImage());&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change PictureBox Cursor==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
public class PictureBoxCursorChange : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  private System.ruponentModel.Container components = null;&lt;br /&gt;
  private PictureBox picBox = new PictureBox();&lt;br /&gt;
  public PictureBoxCursorChange()&lt;br /&gt;
  {&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
    picBox.SizeMode = PictureBoxSizeMode.StretchImage;&lt;br /&gt;
    picBox.Location = new System.Drawing.Point(64, 32);&lt;br /&gt;
    picBox.Size = new System.Drawing.Size(50, 50);&lt;br /&gt;
    picBox.Image = new Bitmap(&amp;quot;yourFile.bmp&amp;quot;);&lt;br /&gt;
        picBox.Cursor = Cursors.Hand;&lt;br /&gt;
    Controls.Add(picBox);&lt;br /&gt;
  }&lt;br /&gt;
  protected override void Dispose( bool disposing )&lt;br /&gt;
  {&lt;br /&gt;
    picBox.Dispose();&lt;br /&gt;
    if( disposing )&lt;br /&gt;
    {&lt;br /&gt;
      if (components != null) &lt;br /&gt;
      {&lt;br /&gt;
        components.Dispose();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    base.Dispose( disposing );&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private void InitializeComponent()&lt;br /&gt;
  {&lt;br /&gt;
    this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
    this.ClientSize = new System.Drawing.Size(292, 273);&lt;br /&gt;
  }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new PictureBoxCursorChange());&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Create an in-memory bitmap and draw and Display the bitmap in the picture box==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class BitmapCreateDrawing : Form&lt;br /&gt;
{&lt;br /&gt;
    public BitmapCreateDrawing()&lt;br /&gt;
    {&lt;br /&gt;
        this.panel1 = new System.Windows.Forms.Panel();&lt;br /&gt;
        this.pictureBox1 = new System.Windows.Forms.PictureBox();&lt;br /&gt;
        this.panel1.SuspendLayout();&lt;br /&gt;
        ((System.ruponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();&lt;br /&gt;
        this.SuspendLayout();&lt;br /&gt;
        // &lt;br /&gt;
        // panel1&lt;br /&gt;
        // &lt;br /&gt;
        this.panel1.AutoScroll = true;&lt;br /&gt;
        this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;&lt;br /&gt;
        this.panel1.Controls.Add(this.pictureBox1);&lt;br /&gt;
        this.panel1.Location = new System.Drawing.Point(12, 12);&lt;br /&gt;
        this.panel1.Size = new System.Drawing.Size(268, 242);&lt;br /&gt;
        this.pictureBox1.Location = new System.Drawing.Point(73, 62);&lt;br /&gt;
        this.pictureBox1.Size = new System.Drawing.Size(111, 144);&lt;br /&gt;
        this.pictureBox1.TabStop = false;&lt;br /&gt;
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);&lt;br /&gt;
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;&lt;br /&gt;
        this.ClientSize = new System.Drawing.Size(296, 270);&lt;br /&gt;
        this.Controls.Add(this.panel1);&lt;br /&gt;
        this.panel1.ResumeLayout(false);&lt;br /&gt;
        ((System.ruponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();&lt;br /&gt;
        this.ResumeLayout(false);&lt;br /&gt;
        string text = &amp;quot;string&amp;quot;;&lt;br /&gt;
        Font font = new Font(&amp;quot;Tahoma&amp;quot;, 20);&lt;br /&gt;
        &lt;br /&gt;
        Bitmap b = new Bitmap(600, 600);&lt;br /&gt;
        using (Graphics g = Graphics.FromImage(b))&lt;br /&gt;
        {&lt;br /&gt;
            g.FillRectangle(Brushes.White, new Rectangle(0, 0, &lt;br /&gt;
                b.Width, b.Height));&lt;br /&gt;
            g.DrawString(text, font, Brushes.Black, 50, 60);&lt;br /&gt;
        }&lt;br /&gt;
        pictureBox1.BackgroundImage = b;&lt;br /&gt;
        pictureBox1.Size = b.Size;&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
    [STAThread]&lt;br /&gt;
    static void Main()&lt;br /&gt;
    {&lt;br /&gt;
        Application.EnableVisualStyles();&lt;br /&gt;
        Application.SetCompatibleTextRenderingDefault(false);&lt;br /&gt;
        Application.Run(new BitmapCreateDrawing());&lt;br /&gt;
    }&lt;br /&gt;
    private System.Windows.Forms.Panel panel1;&lt;br /&gt;
    private System.Windows.Forms.PictureBox pictureBox1;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Normal PictureBox==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class PictureBoxNormal : Form&lt;br /&gt;
{&lt;br /&gt;
  public PictureBoxNormal()&lt;br /&gt;
  {&lt;br /&gt;
    Size = new Size(550,500);&lt;br /&gt;
    AutoScroll = true;&lt;br /&gt;
    Image img = Image.FromFile(&amp;quot;YourFile.bmp&amp;quot;);&lt;br /&gt;
    Label lblNormal = new Label();&lt;br /&gt;
    lblNormal.Parent = this;&lt;br /&gt;
    lblNormal.Location = new Point(0,20);&lt;br /&gt;
    lblNormal.Size = new Size(75,25);&lt;br /&gt;
    lblNormal.TextAlign = ContentAlignment.MiddleRight;&lt;br /&gt;
    lblNormal.Text = &amp;quot;Normal:&amp;quot;;&lt;br /&gt;
    PictureBox pbNormalBig = new PictureBox();&lt;br /&gt;
    pbNormalBig.Parent = this;&lt;br /&gt;
    pbNormalBig.Size = new Size(200, 200);&lt;br /&gt;
    pbNormalBig.Location = new Point(75,20);&lt;br /&gt;
    pbNormalBig.BorderStyle = BorderStyle.FixedSingle;&lt;br /&gt;
    pbNormalBig.SizeMode = PictureBoxSizeMode.Normal;&lt;br /&gt;
    pbNormalBig.Image = img;&lt;br /&gt;
  }&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new PictureBoxNormal());&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==StretchImage PictureBox==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class PictureBoxStretchImage : Form&lt;br /&gt;
{&lt;br /&gt;
  public PictureBoxStretchImage()&lt;br /&gt;
  {&lt;br /&gt;
    Size = new Size(550,500);&lt;br /&gt;
    AutoScroll = true;&lt;br /&gt;
    Image img = Image.FromFile(&amp;quot;YourFile.bmp&amp;quot;);&lt;br /&gt;
    Label lblStretch = new Label();&lt;br /&gt;
    lblStretch.Parent = this;&lt;br /&gt;
    lblStretch.Location = new Point(0,710);&lt;br /&gt;
    lblStretch.Size = new Size(75,25);&lt;br /&gt;
    lblStretch.TextAlign = ContentAlignment.MiddleRight;&lt;br /&gt;
    lblStretch.Text = &amp;quot;StretchImage:&amp;quot;;&lt;br /&gt;
    PictureBox pbStretchBig = new PictureBox();&lt;br /&gt;
    pbStretchBig.Parent = this;&lt;br /&gt;
    pbStretchBig.Size = new Size(200, 200);&lt;br /&gt;
    pbStretchBig.Location = new Point(75,710);&lt;br /&gt;
    pbStretchBig.BorderStyle = BorderStyle.FixedSingle;&lt;br /&gt;
    pbStretchBig.SizeMode = PictureBoxSizeMode.StretchImage;&lt;br /&gt;
    pbStretchBig.Image = img;&lt;br /&gt;
    PictureBox pbStretchSmall = new PictureBox();&lt;br /&gt;
    pbStretchSmall.Parent = this;&lt;br /&gt;
    pbStretchSmall.Size = new Size(100, 100);&lt;br /&gt;
    pbStretchSmall.Location = new Point(325,710);&lt;br /&gt;
    pbStretchSmall.BorderStyle = BorderStyle.FixedSingle;&lt;br /&gt;
    pbStretchSmall.SizeMode = PictureBoxSizeMode.StretchImage;&lt;br /&gt;
    pbStretchSmall.Image = img;&lt;br /&gt;
  }&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new PictureBoxStretchImage());&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>