Represents an affine transformation by a 3 x 3 matrix. Pair (sx, sy) indicates the scale transformation, pair (rs0, rs1) indicates the rotation transformation, pair (tx, ty) indicates the translation transformation. The third column of this matrix is always (0, 0, 1). This class cannot be inherited.
public sealed class Matrix: Object
ObjectMatrix
// This sample shows how to implement the Matrix class.
using System.Drawing;
using System.Windows.Forms;
public class MyControl : System.Windows.Forms.Control
{
protected override void OnPaint( PaintEventArgs e )
{
// Creates a new instance of the Matrix.
Matrix myMatrix = new Matrix(/*sx*/180,/*rs0*/200,/*rs1*/100,/*sy*/0,/*tx*/190,/*ty*/140);
// Initializes the Gradient object with 6 gradient color elements.
gd.SetColor( 0, Color.FromArgb(255,0,0) );
gd.SetColor( 1, Color.FromArgb(0,255,0) );
gd.SetColor( 2, Color.FromArgb(0,0,255) );
gd.SetColor( 3, Color.FromArgb(255,0,0) );
gd.SetColor( 4, Color.FromArgb(0,255,0) );
gd.SetColor( 5, Color.FromArgb(100,100,100) );
// Draws two rectangles filled with the gradient color elements.
v.BeginRadialGradientFill( gd, myMatrix);
v.DrawRectangle(190,140,190,140);
}
}
public class Form1 : System.Windows.Forms.Form
{
private MyControl control1= null;
public Form1()
{
InitializeComponent();
}
private void InitializeComponent()
{
control1= new MyControl();
control1.Location= new System.Drawing.Point(10,10);
control1.Size= new Size(Application.Width-10,Application.Height-10);
Controls.Add( control1);
ResumeLayout(false);
}
static void Main()
{
Application.Run( new Form1() );
}
}
Namespace System.Drawing Flash Library System.Drawing.scl Flash Library Version 2.0.0.1291 Silverlight Library System.Windows.Forms.dll
| © 2003-2007 NETiKA Technologies. All rights reserved. |