<?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%2FC_Sharp%2F2D_Graphics%2FMatrix</id>
		<title>Csharp/C Sharp/2D Graphics/Matrix - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2F2D_Graphics%2FMatrix"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/2D_Graphics/Matrix&amp;action=history"/>
		<updated>2026-04-29T17:48:33Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/2D_Graphics/Matrix&amp;diff=835&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/2D_Graphics/Matrix&amp;diff=835&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:19Z</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/C_Sharp/2D_Graphics/Matrix&amp;diff=836&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/2D_Graphics/Matrix&amp;diff=836&amp;oldid=prev"/>
				<updated>2010-05-26T11:41:54Z</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;==Matrix Demo==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
GDI+ Programming in C# and VB .NET&lt;br /&gt;
by Nick Symmonds&lt;br /&gt;
Publisher: Apress&lt;br /&gt;
ISBN: 159059035X&lt;br /&gt;
*/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Drawing.Drawing2D;&lt;br /&gt;
namespace Matrix_c&lt;br /&gt;
{&lt;br /&gt;
    public class Matrix1&lt;br /&gt;
    {&lt;br /&gt;
        [STAThread]&lt;br /&gt;
        static void Main(string[] args)&lt;br /&gt;
        {&lt;br /&gt;
          Matrix m = new Matrix();&lt;br /&gt;
          m.Rotate(90, MatrixOrder.Append);&lt;br /&gt;
          m.Translate(7, 12, MatrixOrder.Append);&lt;br /&gt;
          Point[] p = {new Point(20, 45)};&lt;br /&gt;
          Console.WriteLine(p.GetValue(0).ToString());&lt;br /&gt;
          m.TransformPoints(p);&lt;br /&gt;
          Console.WriteLine(p.GetValue(0).ToString());&lt;br /&gt;
    &lt;br /&gt;
          Console.ReadLine();&lt;br /&gt;
    }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Matrix Draw==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
GDI+ Programming in C# and VB .NET&lt;br /&gt;
by Nick Symmonds&lt;br /&gt;
Publisher: Apress&lt;br /&gt;
ISBN: 159059035X&lt;br /&gt;
*/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Drawing.Drawing2D;&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;
namespace MatrixDraw_c&lt;br /&gt;
{&lt;br /&gt;
  public class MatrixDraw : System.Windows.Forms.Form&lt;br /&gt;
    {&lt;br /&gt;
    internal System.Windows.Forms.HScrollBar rotate;&lt;br /&gt;
    internal System.Windows.Forms.VScrollBar xlate;&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// Required designer variable.&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        private System.ruponentModel.Container components = null;&lt;br /&gt;
    int XlateY;&lt;br /&gt;
    float Angle;&lt;br /&gt;
    Rectangle DrawingRect = new Rectangle(25, 25, 225, 225);&lt;br /&gt;
&lt;br /&gt;
        public MatrixDraw()&lt;br /&gt;
        {&lt;br /&gt;
            //&lt;br /&gt;
            // Required for Windows Form Designer support&lt;br /&gt;
            //&lt;br /&gt;
            InitializeComponent();&lt;br /&gt;
      Angle = 0;&lt;br /&gt;
      XlateY = 0;&lt;br /&gt;
      xlate.Minimum = -50;&lt;br /&gt;
      xlate.Maximum = 50;&lt;br /&gt;
      xlate.SmallChange = 1;&lt;br /&gt;
      xlate.LargeChange = 5;&lt;br /&gt;
      xlate.Value = 0;&lt;br /&gt;
      rotate.Minimum = -180;&lt;br /&gt;
      rotate.Maximum = 180;&lt;br /&gt;
      rotate.SmallChange = 1;&lt;br /&gt;
      rotate.LargeChange = 10;&lt;br /&gt;
      rotate.Value = 0;&lt;br /&gt;
      this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);&lt;br /&gt;
      this.SetStyle(ControlStyles.DoubleBuffer, true);&lt;br /&gt;
      this.SetStyle(ControlStyles.UserPaint, true);&lt;br /&gt;
    }&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// Clean up any resources being used.&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        protected override void Dispose( bool disposing )&lt;br /&gt;
        {&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;
        #region Windows Form Designer generated code&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// Required method for Designer support - do not modify&lt;br /&gt;
        /// the contents of this method with the code editor.&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        private void InitializeComponent()&lt;br /&gt;
        {&lt;br /&gt;
      this.rotate = new System.Windows.Forms.HScrollBar();&lt;br /&gt;
      this.xlate = new System.Windows.Forms.VScrollBar();&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      // &lt;br /&gt;
      // rotate&lt;br /&gt;
      // &lt;br /&gt;
      this.rotate.Location = new System.Drawing.Point(8, 240);&lt;br /&gt;
      this.rotate.Name = &amp;quot;rotate&amp;quot;;&lt;br /&gt;
      this.rotate.Size = new System.Drawing.Size(240, 16);&lt;br /&gt;
      this.rotate.TabIndex = 3;&lt;br /&gt;
      this.rotate.Scroll += new System.Windows.Forms.ScrollEventHandler(this.rotate_Scroll);&lt;br /&gt;
      // &lt;br /&gt;
      // xlate&lt;br /&gt;
      // &lt;br /&gt;
      this.xlate.Location = new System.Drawing.Point(264, 32);&lt;br /&gt;
      this.xlate.Name = &amp;quot;xlate&amp;quot;;&lt;br /&gt;
      this.xlate.Size = new System.Drawing.Size(16, 200);&lt;br /&gt;
      this.xlate.TabIndex = 2;&lt;br /&gt;
      this.xlate.Scroll += new System.Windows.Forms.ScrollEventHandler(this.xlate_Scroll);&lt;br /&gt;
      // &lt;br /&gt;
      // MatrixDraw&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;
      this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                                                  this.rotate,&lt;br /&gt;
                                                                  this.xlate});&lt;br /&gt;
      this.MaximizeBox = false;&lt;br /&gt;
      this.MinimizeBox = false;&lt;br /&gt;
      this.Name = &amp;quot;MatrixDraw&amp;quot;;&lt;br /&gt;
      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;&lt;br /&gt;
      this.Text = &amp;quot;MatrixDraw&amp;quot;;&lt;br /&gt;
      this.Load += new System.EventHandler(this.MatrixDraw_Load);&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
        #endregion&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// The main entry point for the application.&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        [STAThread]&lt;br /&gt;
        static void Main() &lt;br /&gt;
        {&lt;br /&gt;
            Application.Run(new MatrixDraw());&lt;br /&gt;
        }&lt;br /&gt;
    private void MatrixDraw_Load(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      Graphics G  = e.Graphics;&lt;br /&gt;
      G.SmoothingMode = SmoothingMode.AntiAlias;&lt;br /&gt;
      // Create a graphics path, add a rectangle, set colors&lt;br /&gt;
      GraphicsPath Path = new GraphicsPath();&lt;br /&gt;
      Path.AddRectangle(new Rectangle(75, 100, 100, 75));&lt;br /&gt;
      PointF[] Pts  = Path.PathPoints;&lt;br /&gt;
      PathGradientBrush B = new PathGradientBrush(Pts);&lt;br /&gt;
      B.CenterColor = Color.Aqua;&lt;br /&gt;
      Color[] SColor = {Color.Blue};&lt;br /&gt;
      B.SurroundColors = SColor;&lt;br /&gt;
      //We will translate the brush!  NOT the rectangle!&lt;br /&gt;
      Matrix m = new Matrix();&lt;br /&gt;
      m.Translate(0, XlateY, MatrixOrder.Append);&lt;br /&gt;
      m.RotateAt(Angle, B.CenterPoint, MatrixOrder.Append);&lt;br /&gt;
      B.MultiplyTransform(m, MatrixOrder.Append);&lt;br /&gt;
      G.FillRectangle(B, DrawingRect);&lt;br /&gt;
      base.OnPaint(e);&lt;br /&gt;
      m.Dispose();&lt;br /&gt;
      B.Dispose();&lt;br /&gt;
      Path.Dispose();&lt;br /&gt;
    }&lt;br /&gt;
    private void xlate_Scroll(object sender, &lt;br /&gt;
                              System.Windows.Forms.ScrollEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      XlateY = xlate.Value;&lt;br /&gt;
      this.Invalidate(DrawingRect);&lt;br /&gt;
    }&lt;br /&gt;
    private void rotate_Scroll(object sender, &lt;br /&gt;
                               System.Windows.Forms.ScrollEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      Angle = rotate.Value;&lt;br /&gt;
      this.Invalidate(DrawingRect);&lt;br /&gt;
    }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==new Matrix(, , -, , 0, 0)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Drawing.Drawing2D;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
   &lt;br /&gt;
class MobyDick: Form&lt;br /&gt;
{&lt;br /&gt;
     public static void Main()&lt;br /&gt;
     {&lt;br /&gt;
          Application.Run(new MobyDick());&lt;br /&gt;
     }&lt;br /&gt;
     public MobyDick()&lt;br /&gt;
     {&lt;br /&gt;
          ResizeRedraw = true; &lt;br /&gt;
     }&lt;br /&gt;
     protected override void OnPaint(PaintEventArgs pea)&lt;br /&gt;
     {&lt;br /&gt;
          DoPage(pea.Graphics, ForeColor,ClientSize.Width, ClientSize.Height);&lt;br /&gt;
     }     &lt;br /&gt;
     protected void DoPage(Graphics grfx, Color clr, int cx, int cy)&lt;br /&gt;
     {&lt;br /&gt;
          grfx.Transform = new Matrix(0.707f, 0.707f, -0.707f, 0.707f, 0, 0);&lt;br /&gt;
          grfx.DrawString(&amp;quot;abc&amp;quot;, Font, new SolidBrush(clr), &lt;br /&gt;
                          new Rectangle(0, 0, cx, cy));&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Text direction (Matrix Rotate)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&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;
using System.Drawing.Drawing2D;&lt;br /&gt;
public class Form1 : System.Windows.Forms.Form {&lt;br /&gt;
    [STAThread]&lt;br /&gt;
    static void Main() {&lt;br /&gt;
        Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
    protected override void OnPaint(PaintEventArgs e) {&lt;br /&gt;
        Graphics g = CreateGraphics();&lt;br /&gt;
        string txt = &amp;quot;HELLO&amp;quot;;&lt;br /&gt;
        float alpha = 45.0f;&lt;br /&gt;
        int fontSize = 24;&lt;br /&gt;
        Point center = new Point(90, 20);&lt;br /&gt;
        FontFamily ff = new FontFamily(&amp;quot;Times New Roman&amp;quot;);&lt;br /&gt;
        Font f = new Font(ff, fontSize, FontStyle.Regular);&lt;br /&gt;
        StringFormat sf = new StringFormat();&lt;br /&gt;
        sf.FormatFlags = StringFormatFlags.DirectionVertical;&lt;br /&gt;
        g.DrawString(txt, f, new SolidBrush(Color.Blue), center, sf);&lt;br /&gt;
        g.TranslateTransform(center.X, center.Y);&lt;br /&gt;
        g.DrawEllipse(Pens.Magenta, new Rectangle(0, 0, 1, 1));&lt;br /&gt;
        GraphicsPath gp = new GraphicsPath();&lt;br /&gt;
        gp.AddString(txt, ff, (int)FontStyle.Bold, fontSize + 4, new Point(0, 0), sf);&lt;br /&gt;
        Matrix m = new Matrix();&lt;br /&gt;
        m.Rotate(alpha);&lt;br /&gt;
        gp.Transform(m);&lt;br /&gt;
        g.DrawPath(Pens.Red, gp);&lt;br /&gt;
        g.RotateTransform(-alpha);&lt;br /&gt;
        g.DrawString(txt, f, new SolidBrush(Color.Black), 0, 0, sf);&lt;br /&gt;
        gp.Dispose(); g.Dispose(); m.Dispose();&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>